First time initialization
mkdir $HOME/.dotfiles
git init --bare $HOME/.dotfiles
alias dotfiles="/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME"
dotfiles remote add origin <remote-url>
echo ".dotfiles" >> .gitignore
Clone existing repo
git clone --bare <remote-git-repo-url> --branch <some-branch> $HOME/.dotfiles
alias dotfiles="/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME"
dotfiles config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
dotfiles checkout --force