왜 dotfile 을 버전 관리?
너의 ~/.zshrc, ~/.gitconfig, ~/.ssh/config, 그 외 십 수 개가 네 컴퓨터의 인격. 잃으면 새 Mac 이 며칠간 낯설어. git 에 담아두면 10 분 안에 자기를 복제.
plain git 접근
cd ~
git init --bare $HOME/.dotfiles.git
alias config='/usr/bin/git --git-dir=$HOME/.dotfiles.git --work-tree=$HOME'
config config status.showUntrackedFiles no
config add .zshrc .gitconfig .config/starship.toml
config commit -m 'starting'
config push -u origin main홈을 working tree 로 다루되 명시적으로 추가한 파일만 추적. 새 Mac 에서 같은 alias + config checkout 으로 복원.
chezmoi — 전용 도구
brew install chezmoi. chezmoi init https://github.com/me/dotfiles. 파일은 별도 source 에 살고 chezmoi apply 가 홈에 적용. 템플릿, 비밀번호 매니저 연동, OS 조건부 내용. 가장 인기 있는 dotfile 매니저.
GNU Stow — symlink 농장
brew install stow. ~/dotfiles/zsh/ 등에 홈 구조 미러링, stow zsh 가 ~/.zshrc 에서 repo 로 symlink. 가볍고 템플릿 엔진 없음.
추적할 것 / 말 것
- 추적: .zshrc, .gitconfig, .ssh/config (키는 빼고), .config/{starship,nvim,fish}, .vimrc, .tmux.conf, .editorconfig, .gitignore_global.
- 제외: .env, .ssh/id_*, .ssh/known_hosts, .cache / .npm / .pyenv / .docker 안의 것. 상태와 비밀은 설정 아님.
Pippa 패턴
Pippa fleet 은 office-Mac-source-of-truth 모델. office 가 새 dotfile 변경 작성, peer 들은 sha256 검증하는 fleet-deploy 스크립트로 fan-out. 원리는 chezmoi 와 같음 — repo 하나, 머신 다수, idempotent 복원.