0

Is it possible to define a user in ./git/config per remote like this?

I have mutliple remote with commits that shoud be tagged by the user linked to the remote.

Didn't find any answer on SO for this.

Found the tip with includeIf but that's not what I'm seeking.

[ remote "toto"]
    url = ssh://127.1.2.3:22/totoremote
    fetch = +refs/heads/*:refs/remotes/toto/*
[ user "toto" ]
    name = theUserForToto
    email = theuserfortoto@tata.com
Paul
  • 1,410
  • 1
  • 14
  • 30
  • 2
    `user.name` and `user.email` config values are used when a commit is created. At that time, there is no remote that plays any part in the process, so it is not possible to do what you are asking. – 1615903 Feb 14 '22 at 07:44
  • Not exactly a duplicate, but contains the answer to how to set up per-remote authentication. – torek Feb 15 '22 at 18:54
  • Yes it is more about setting username and email for commit depending on remote. – Paul Feb 16 '22 at 09:43

0 Answers0