Date: <2022-08-23 Tue>

Version: 1.2

Store all DotFiles in a bare git repository

Setup

  1. git init –bare $HOME/.cfg
  2. alias config=’usr/bin/git –git-dir=$HOME.cfg/ –work-tree=$HOME'
  3. echo “alias config=’usr/local/bin/git –git-dir=$HOME.cfg/ –work-tree=$HOME’” >> $HOME/.zsh/aliases
  4. 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

  1. config remote add origin <remote-url>
  2. config push -u origin main

Restore files from github

  1. echo “.cfg” >> .gitignore
  2. git clone <remote-git-repo-url> $HOME/.cfg
  3. alias config=’/usr/local/bin/git –git-dir=<path to .cfg’s Git directory> –work-tree=$HOME'
  4. config config –local status.showUntrackedFiles no
  5. config checkout