Upgrade to Pro — share decks privately, control downloads, hide ads and more …

dotfilesを管理しよう / get-started-with-dotfiles-management

yammerjp
January 26, 2023
560

dotfilesを管理しよう / get-started-with-dotfiles-management

2023/01/26 CTOA 若手エンジニアコミュニティ LT会

yammerjp

January 26, 2023
Tweet

Transcript

  1. 自己紹介 やんまー @yammerjp 中山 慶祐 GMO ペパボ株式会社 Web アプリケーションエンジニア 月刊誌

    Software Design にて 「開発環境 探求の道」を連載中 https://yammer.jp 2
  2. dotfiles とは? Unix/Linux における ユーザごとの アプリケーションの設定ファイル .bashrc 、.zshrc 、.vimrc 、.gitconfig

    、、、等々 ホームディレクトリに、ドットで始まるファイル名のものが多い 8
  3. 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
  4. 14

  5. 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
  6. 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