- Clone repo
git clone --bare https://github.com/Javiery3889/dotfiles.git $HOME/.dotfiles
- Set alias in shell
rc
file, e.g..bashrc
or.zshrc
alias dotfiles='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'
- Checkout actual contents from the bare repo
dotfiles checkout
This command may return an error due to existing configuration files, you can either choose to backup or remove these files.
To backup configuration files, you can use the following command to do (credits to this post at atlassian):
mkdir -p .config-backup && \
config checkout 2>&1 | egrep "\s+\." | awk {'print $1'} | \
xargs -I{} mv {} .config-backup/{}
- Ignore untracked files in the local repo
dotfiles config --local status.showUntrackedFiles no