質問

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?

役に立ちましたか?

解決

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.

他のヒント

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

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top