It seems like just saying git config user.name (or user.email ) in a specific repository without specifying --global or --system will do the trick. By default, the configuration setting in the current repository is used, and you must give it explicit options in order to write to your user or system-wide configuration instead.
I do not know how to do this if you recently clone repositories that need a different configuration. Perhaps you could write a small script that wraps git clone to clone some repository, and then set the appropriate configuration based on any information? If you release the script in /usr/lib/git-core , named something like git-nclone , you can run it as git nclone .
Change Since you donβt want to manually install it every time, what about the clone shell, which remembers the different sets that you use and allows you to choose the one suitable for the repository that you are cloning. It can even have smart defaults based on where you clone from.
Novelocrat
source share