Create a git repo directly in your home folder, .g. ~/dotfiles
In this directory, you create a folder with a "package name" and in it the exact folder structure this app has it's config files in your home folder.
Let's take i3
for example, which has its config file in ~/.config/i3/config
Move this file into ~/dotfiles/i3/.config/i3/config
. Now you can git add
and git commit
it, like usual.