Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
dotfilesを管理しよう / get-started-with-dotfiles-mana...
Search
yammerjp
January 26, 2023
0
1.4k
dotfilesを管理しよう / get-started-with-dotfiles-management
2023/01/26 CTOA 若手エンジニアコミュニティ LT会
yammerjp
January 26, 2023
Tweet
Share
More Decks by yammerjp
See All by yammerjp
生成AIとの対話から、概念をみつけ、名前をつける / Name it with generative AI
yammerjp
2
2.1k
awkでつくってわかるWebアプリケーション / Web Application Implementation in awk
yammerjp
14
9.5k
awk basics
yammerjp
1
610
jpro: JSON Processor
yammerjp
0
650
クイズを作ってPHPに親しむ / Make quizzes and get familiar with PHP
yammerjp
2
1.8k
比較演算を壊してみる / php-break-comparison
yammerjp
1
1.2k
切り取り方を工夫してアプリケーションを漸進的に改善する / Incremental improvement by devising application change boundaries
yammerjp
1
1.9k
社用PCのdotfiles管理 / dotfiles-in-company
yammerjp
1
2.6k
開発チームの新しいエンジニアメンバーがうまくやるには / newcomer-in-development-team
yammerjp
0
1.9k
Featured
See All Featured
Git: the NoSQL Database
bkeepers
PRO
431
65k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
60k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.3k
Navigating Team Friction
lara
188
15k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Building Better People: How to give real-time feedback that sticks.
wjessup
367
19k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
8
880
The Invisible Side of Design
smashingmag
301
51k
We Have a Design System, Now What?
morganepeng
53
7.7k
Thoughts on Productivity
jonyablonski
69
4.8k
Making the Leap to Tech Lead
cromwellryan
134
9.5k
Transcript
dotfiles を管理しよう 2023/01/27 CTO 協会 若手エンジニアコミュニティ LT 会 やんまー @yammerjp
1
自己紹介 やんまー @yammerjp 中山 慶祐 GMO ペパボ株式会社 Web アプリケーションエンジニア 月刊誌
Software Design にて 「開発環境 探求の道」を連載中 https://yammer.jp 2
dotfiles とは 3
.bashrc 4
.zshrc 5
.gitconfig 6
.vimrc 7
dotfiles とは? Unix/Linux における ユーザごとの アプリケーションの設定ファイル .bashrc 、.zshrc 、.vimrc 、.gitconfig
、、、等々 ホームディレクトリに、ドットで始まるファイル名のものが多い 8
dotfiles の例 .gitconfig [user] name = Keisuke Nakayama email =
[email protected]
[include] path = ~/.config/git/config-company [alias] l = log --graph \ --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' \ --abbrev-commit --date=relative sw = !git branch --all --format=\"%(refname:short)\" | fzf | xargs git checkout https://github.com/yammerjp/dotfiles/blob/master/.config/git/config 9
dotfiles の利用例 git l で、ブランチのマージ 状況を視覚的に表示したログ を表示 https://github.com/yammerjp/dotfiles/blob /3b3813ed3f9c8e06006fef14d30df14cb3 228738/.config/git/config#L41
10
dotfiles の利用例 NeoVim 上でショートカット sf を押して、リポジトリ内の 記述を曖昧検索して開く https://github.com/yammerjp/dotfiles/blob /3b3813ed3f9c8e06006fef14d30df14cb3 228738/.config/nvim/init.vim#L121
https://github.com/yammerjp/dotfiles/blob /3b3813ed3f9c8e06006fef14d30df14cb3 228738/.config/nvim/init.vim#L171 11
今日は設定の中身ではなく .. 12
dotfiles の管理 13
14
dotfiles の管理 GitHub にある「dotfiles 」リポジトリ 変更履歴を記録できる 他のマシンへ設定を適用しやすい そのほかにも Public リポジトリであれば、他の人へ共有しやすい
開発環境を構成するツールやシェルスクリプトなどに詳しくなる 例: yammerjp/dotfiles 15
dotfiles 管理をはじめる GitHub にリポジトリを作る* ... https://github.com/new ファイルをコピーしてcommit 、push $ git
clone https://github.com/ あなたのGitHub ユーザ名/dotfiles.git ~/dotfiles $ cd dotfiles $ cp ~/.gitconfig ~/dotfiles/.gitconfig $ git add .gitconfig $ git commit -m "Add .gitconfig" $ git push origin main * 各ファイルの中身を公開して良いかわからなければ、ひとまずPrivate にしておくとよ いだろう 16
ホームディレクトリ のファイルを Git で 管理する シンボリックリンクを用いる Git リポジトリにあるファイル を、ホームディレクトリから 参照可能にする
$ mv ~/.gitconfig ~/.gitconfig.org $ ln -s ~/dotfiles/.gitconfig ~/.gitconfig 17
ln コマンド以外で管理する Git のbare リポジトリを使う $ alias dotfiles='git --git-dir=$HOME/.dotfiles --work-tree=$HOME'
Dotfiles: ベア Git リポジトリに保存する最もよい方法 - Atlassian Git Tutorial dotfiles の管理ツールを使う chezmoi, yadm, Dotbot, rcm, GNU Stow, ... 18
dotfiles の管理、はじめてみませんか? 自分好みにカスタマイズして素早く効率的に作業できる 他のマシンでも環境を再現できる ソフトウェアエンジニアの工具箱* ともいえるかもしれない (*)https://scrapbox.io/june29/ 父親の工具箱 19