I'm looking for a way to work with multiple users of mine with GIT.
I want to be able to switch easily user-specific configurations, that I need at the moment.
Something like a group flag for a bunch of settings in .gitconfig
.
I saw this question, but couldn't find satisfaction in the suggested answers:
- The selected answer suggests to use the
git config
command in the repo, but it's error prune and not so comfortable to do it every time. - The answer about the folder conditional include is very nice, but it will work only if there's a specific rule for the folder matching those configurations, which there isn't, since it's not necessarily under the same path.
Any other possible solution I'm missing?
What I thought about, in case there isn't a builtin/known way, is to write a script that will get a parameter of the current environment name I want and will run some git config
commands locally on the current repo folder.