Based on the Hacker News thread and Atlassian tutorial
- Clone into a bare repository:
git clone --bare git@github.com:mihirsd/dotfiles.git $HOME/.dotfiles
- Define the alias in the current shell scope:
alias dotfiles='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'
- Checkout the content from the bare repository to
$HOME
:
dotfiles checkout
If the command fails, backup or remove the conflicting files.
- Set the flag
showUntrackedFiles
tono
on this local repository:
dotfiles config --local status.showUntrackedFiles no
- That's it! Use the
dotfiles
command to add or update dotfiles
dotfiles status
dotfiles add .bashrc
dotfiles commit -m "Add bashrc"
dotfiles push