- Add alias to bashrc/zshrc
alias config='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'
- Clone the repo
git clone --bare <git-repo-url> $HOME/.dotfiles
- Define the alias in the current shell scope:
alias config='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME'
- Checkout the actual content from the bare repository to your $HOME:
config checkout
The step above might fail with a message like:
error: The following untracked working tree files would be overwritten by checkout:
.bashrc
.gitignore
Please move or remove them before you can switch branches. Re-run the check out if you had problems
config checkout
- Set the flag showUntrackedFiles to no on this specific (local) repository:
config config --local status.showUntrackedFiles no