I watched a video by DistroTube where he showed how to manage your dotfiles with a git bare repository. I've been using this strategy for quite some time now, and I'm very pleased with it, so here is what I've done...
Prepare/installCreate cache directory and init git bare repo:
Add an alias to your shell:
mkdir -p $HOME/.cache/df-git git init --bare $HOME/.cache/df-git
Reload your shell the command below, it will be much easier if you only manage the files you specifically add yourself.
alias df-git='git --git-dir=$HOME/.cache/df-git --work-tree=$HOME'
Connect to a remote repository, there are several alternatives like Github, Gitlab and the likes of them, follow their instructions, but usedf-git wherever they tell you to use git.
df-git config --local status.showUntrackedFiles no
UsageYou get all the power you get with git, you just have to remember to use df-git instead of the normal git.
df-git add /path/to/file df-git commit -m "Some message describing the change" df-git push