I have a repository in my local machine. This repository has 2 git remotes. Remotes A and B.
user.name
X and user.email
Y.user.name
Z and user.email
W.Can this be achieved in git? If so, how?
With Git 2.13, you now have conditional include for git config
, but it is only based on filesystem path of the repository.
So you still need two different copies of the same repo. You can achieve that with git worktree
(one clone, multiple working tree)
You can then modify your global config spec to include a local config with a specific set of user.name/user.email depending on your current folder.
See "Using different Git emails" from pltvs
(Alex Pliutau)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With