Specifically, I maintain a git repository of my dotfiles. I recently started working on a new machine and cloned my repository on the same.
Now, I wish to make some
Here is an alternative solution to your specific problem. Place machine-config configuration in a ~/.gitconfig.local file, and then put the following in your version-controlled ~/.gitconfig:
[include]
path = ~/.gitconfig.local
This will tell Git to treat anything it finds in ~/.gitconfig.local as if it were in ~/.gitconfig. Yes, you can override settings. No, it does not require the file to exist (Git will silently ignore the setting if there is no ~/.gitconfig.local).
See here for more information about [include].
I follow this strategy in my configurations for Emacs, Zsh, Git, Tmux, etc., so that they are customizable without the need to modify version-controlled files. To accomplish this, I have init.local.el, .zshrc.local, .gitconfig.local, .tmux.local.conf, and so on.