One way to do this, is to use a bare git repository in a folder that you do not call
.git, but for example
.git-dotfiles, and use
git --git-dir=~/.git-dotfiles --work-tree=~ when interacting with the dotfiles you track in your home directory. To make this easier, you'd define an alias for that. Usage could then look like:
git-dotfiles add .zshrc for example.
Because git normally (without a
--git-dir flag) looks only for a
.git directory (or file), it will not find your
.git-dotfiles directory unless you point it to it.
It is advisable to set
status.showUntrackedFiles to false in that repository, otherwise it will list all files in your home directory as untracked files. With that setting it shouldn't even look at untracked files, keeping things fast.
Atlassian published a nice article explaining this method in more detail.