pretty clear
Adapted from: https://www.ackama.com/what-we-think/the-best-way-to-store-your-dotfiles-a-bare-git-repository-explained/
You will basically be using a bare git repo like any other, but instead of git
you will use the config
command.
Be in your home folder:
cd ~
Do not track yourself:
echo ".cfg" >> .gitignore
Clone repo:
git clone --bare https://github.com/wtraceyv/dotfiles.git $HOME/.cfg
On cloning, you should already have an alias in the .zshrc binding
config
togit
, but for that .cfg repo only. At any rate, you will need an alias setup in an rc file for your shell, or just run this locally such that:
alias config='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME'
Make sure local repo ignores untracked files in $HOME (using that alias):
config config --local status.showUntrackedFiles no
Checkout needed branch dotfiles
config checkout <branch>
Rectify collision errors by removing any pre-existing files that are trying to be replaced.
Once the repo is cloned and you successfully checkout a branch, the configs for that branch are loaded and can be used. Whenever you want to add to the repo and track new configs, you can simply
config add <file/folder>
And commit as you please, being sure to use config
in place of the usual git
command.