Date:
Version: 1.2
Store all DotFiles in a bare git repository
Setup
- git init –bare $HOME/.cfg
- alias config=’usr/bin/git –git-dir=$HOME.cfg/ –work-tree=$HOME'
- echo “alias config=’usr/local/bin/git –git-dir=$HOME.cfg/ –work-tree=$HOME’” >> $HOME/.zsh/aliases
- config config –local status.showUntrackedFiles no
Adding files
Manually add files to repository by using config add <filename>. Use this to add all your files manually, this way only updates to your tracked files will show
Add the github repository
- config remote add origin <remote-url>
- config push -u origin main
Restore files from github
- echo “.cfg” >> .gitignore
- git clone <remote-git-repo-url> $HOME/.cfg
- alias config=’/usr/local/bin/git –git-dir=<path to .cfg’s Git directory> –work-tree=$HOME'
- config config –local status.showUntrackedFiles no
- config checkout