This guide assumes the repo is cloned to $HOME/.dotfiles.
git init --bare $HOME/.dotfiles
alias config='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'
config config --local status.showUntrackedFiles no
If config
alias is not in your .zshrc yet.
echo "alias config='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'" >> $HOME/.zshrc
config add .some_dot_file
config commit -m "..."
git remote add origin [email protected]:<user>/<repo>.git
git push -u origin master
Add config
alias (for current shell session)
alias config='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'
Prevent recursion issues
echo ".dotfiles" >> $HOME/.gitignore
Then, clone repo
git clone --bare <git-repo-url> $HOME/.dotfiles
Check out repo content
config checkout
Configure local repo to hide untracked files
config config --local status.showUntrackedFiles no