1

I point to 2 different git repositories

git@github.com:blah/foo.git
git@mycompany.com:random/bar.git

I push two different SSH public key(s) into github.com and mycompany.com When I push code to the respective git repositories, I need to set the user.name and user.email properties for git. How do I set different names/emails for different repositories.

Joe
  • 14,513
  • 28
  • 82
  • 144
  • is your question about how to actually do the pushes (in title) or how to set different properties for multiple repos (in question)? if the latter, see http://stackoverflow.com/questions/4220416/can-i-specify-multiple-users-for-myself-in-gitconfig – smcg Oct 23 '12 at 14:46
  • If I have to set it individually to each repo, where am I supposed to run this command. Is it from the checked out location? – Joe Oct 23 '12 at 14:54
  • 1
    I would assume so since they mention the .git folder, which is project-specific. – smcg Oct 23 '12 at 14:57

1 Answers1

0
$> git config user.mail "mail@a.c"
$> git config user.name o
$> cat .git/config
[user]
    mail = mail@a.c
    name = o

https://help.github.com/articles/setting-your-email-in-git