Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
dotfilesを管理しよう / get-started-with-dotfiles-mana...
Search
yammerjp
January 26, 2023
2k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
dotfilesを管理しよう / get-started-with-dotfiles-management
2023/01/26 CTOA 若手エンジニアコミュニティ LT会
yammerjp
January 26, 2023
More Decks by yammerjp
See All by yammerjp
生成AIとの対話から、概念をみつけ、名前をつける / Name it with generative AI
yammerjp
2
3.1k
awkでつくってわかるWebアプリケーション / Web Application Implementation in awk
yammerjp
14
12k
awk basics
yammerjp
1
1k
jpro: JSON Processor
yammerjp
0
1k
クイズを作ってPHPに親しむ / Make quizzes and get familiar with PHP
yammerjp
2
2.4k
比較演算を壊してみる / php-break-comparison
yammerjp
1
1.6k
切り取り方を工夫してアプリケーションを漸進的に改善する / Incremental improvement by devising application change boundaries
yammerjp
1
2.5k
社用PCのdotfiles管理 / dotfiles-in-company
yammerjp
1
3k
開発チームの新しいエンジニアメンバーがうまくやるには / newcomer-in-development-team
yammerjp
0
2.4k
Featured
See All Featured
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
1k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
690
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2.1k
Thoughts on Productivity
jonyablonski
76
5.4k
YesSQL, Process and Tooling at Scale
rocio
174
15k
GraphQLとの向き合い方2022年版
quramy
50
15k
It's Worth the Effort
3n
188
29k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1.2k
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
2.8k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.6k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
270
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
450
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