For general guidance follow this great write up: https://www.atlassian.com/git/tutorials/dotfiles
git init --bare $HOME/.cfg
alias dotfiles='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME'
dotfiles config --local status.showUntrackedFiles no
echo "alias config='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME'" >> $HOME/.bashrc
dotfiles status
dotfiles add .vimrc
dotfiles commit -m "Add vimrc"
dotfiles add .bashrc
dotfiles commit -m "Add bashrc"
dotfiles push
cd ~
echo ".cfg" >> .gitignore
git clone --bare <git-repo-url> $HOME/.cfg
alias dotfiles='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME'
dotfiles config --local status.showUntrackedFiles no
dotfiles checkout
error: The following untracked working tree files would be overwritten by checkout:
.bashrc
.gitignore
Please move or remove them before you can switch branches.
Aborting
mkdir -p .config-backup && \
config checkout 2>&1 | egrep "\s+\." | awk {'print $1'} | \
xargs -I{} mv {} .config-backup/{}
dotfiles checkout
dotfiles config --local status.showUntrackedFiles no
.aws/config
.gitconfig
.multirc
.oh-my-zsh/custom/aliases.zsh
.oh-my-zsh/custom/example.zsh
.oh-my-zsh/custom/plugins/example/example.plugin.zsh
.oh-my-zsh/custom/themes/example.zsh-theme
.oh-my-zsh/custom/themes/powerlevel10k
.p10k.zsh
.zshrc