[Feature Request] Multi-user Profile Switcher
Hope to save multiple git user profiles, and then could quickly switch in Repository Configure
Not really the same but I wanted to share my "workaround".
You can add this kind of configuration to your global .gitconfig like so:
[includeIf "hasconfig:remote.*.url:[email protected]*/**"]
path = ~/gittools/.gitconfig-github
[includeIf "hasconfig:remote.*.url:https://github.com*/**"]
path = ~/gittools/.gitconfig-github
[includeIf "hasconfig:remote.*.url:[email protected]*/**"]
path = ~/gittools/.gitconfig-gitlab
This includes a specific sub-config only if a remote's url matches a specific pattern.
And then, inside the ~/gittools/.gitconfig-xyz there's your remote-specific user config:
[user]
name = <username>
email = <email>
Now if you leave your user info empty in the repo's config, the right one will be picked automatically if it matches one of the includeif-rules above. I love this feature :) And as it's only using gitconfig-features it is client-agnostic. Once set up, it just works the same for sourcegit, fork etc.