-
Create a git bare repo
git init --bare $HOME/dotfiles
-
Create an alias for git to always execute git commands relative to
$HOME
Put commands in.bashrc
or.zshrc
alias dot='/usr/bin/git --git-dir=$HOME/dotfiles/ --work-tree=$HOME'
-
Set git config so we won't list other
$HOME
filesdot config --local status.showUntrackedFiles no
-
Follow the exact same steps above
-
Add remote repo as origin
dot remote add origin https://github.com/chan-dev/dotfiles.git
If there are any conflicts, make sure to backup the files first -- for example, it conflicts with current
.bashrc
. Then backup bycp ~/.bashrc ~/.bashrc-old
By default,newly installed neovim don't have user configuration under
~/.config
, if this results in a conflict feel free to remove.config/nvim
in your system especially if you're using a customized neovim such as LunarVim.
Reference: https://www.youtube.com/watch?v=tBoLDpTWVOM