Question

Is there a way to clone a repository, add a second remote, but use a different/separate user for that second remote automatically when pushing/pulling?

My use case is to have the remote "origin" only for pulling (actually checking out) changes with "user A" and to have remote "my-second-remote" for pulling AND pushing with "user B".

Is there a way to set up a separate user for each remote?

Était-ce utile?

La solution

Do you mean the user which is used to authenticate against each remote? Then yes — just embed the user name to the remote's URL.

Autres conseils

No, this is impossible in Git. Name and email are embedded in the commits.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top