by _-david-_ · 5y ago · 0 comments
cd ~
git init
git remote add origin [URL]
git fetch
git checkout -f master
git clone --bare <dotifles repo> ~/.dotfiles
git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME checkout
git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME config --local status.showUntrackedFiles no
And then I add an alias: alias cfg='git --git-dir=$HOME/.dotfiles --work-tree=$HOME'
Now I can just manage my dotfiles as a git repo, and I don't have to worry about accidentally adding local secrets to the repo.