Reference: [https://www.atlassian.com/git/tutorials/dotfiles]
-
Add this alias to your .bashrc.
alias config='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME'
-
Tell git to ignore .cfg
echo ".cfg" > .gitignore
-
Clone your dotfiles repo
git clone --bare <git-repo-url> $HOME/.cfg
-
Checkout the actual content from the bare repo to your $HOME.
config checkout
-
Tell git to not show untracked files
config config --local status.showUntrackedFiles no
git clone --bare https://github.com/ssharpjr/cfg.git $HOME/.cfg
function config {
/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME
curl -Lks http://bit.do/ssharpjr-dotfiles | /bin/bash