How to set git committer email by remote

Viewed 50

We keep our icinga2 configuration in a git repository which is owned by the icinga user on the server. We do all the maintenance for those config files as this user. However, we'd like to distinguish who has committed the changes. We setup a .ssh/config file like this:

Host github-user1
  HostName github.myhost.org
  User git
  IdentityFile /var/spool/icinga2/.ssh/user1_rsa
  IdentitiesOnly yes

 Host github-user2
  HostName github.myhost.org
  User git
  IdentityFile /var/spool/icinga2/.ssh/user2_rsa
  IdentitiesOnly yes

That allows us to create different remotes:

sshuser1  git@github-user1:OurOrg/icingaconf.git (fetch)
sshuser1  git@github-user1:OurOrg/icingaconf.git (push)
sshuser2  git@github-user2:OurOrg/icingaconf.git (fetch)
sshuser2  git@github-user2:OurOrg/icingaconf.git (push)

However, the committer in github still shows as icinga because that's the email of the user we're committing as.

Is there a way we can commit using this single application ID but track to different committer email addresses? I tried to find a git config option that tied email address to the remote path but didn't see any such option, only global or repository-specific.

0 Answers
Related