1

GitHub set author/committer

Posted by Jason Noble on 04/21/2009 in git, github, pair programming |

I’ve been working with Git lately and more specifically GitHub. I noticed something odd one day. Where most commits have one author listed, these commits had both a author and a committer listed.

More specifically, the author field was the two members of the pair and the committer name was the workstation they were working on.

Example:

After playing around with it for a while, I figured out how to do it. Within a git project clone, run the following commands.

1) git config user.name = ‘Workstation Perlwizard’
2) git config user.email = ‘devs2@perlwizard.org’
3) export GIT_AUTHOR_NAME=’Bob Smith and Betty Jones’
4) export GIT_AUTHOR_EMAIL=’devs@perlwizard.org’

Both of the email addresses need to be addresses Github doesn’t know about (i.e. not used to sign up for an account).

I could see using this while pairing with someone so you both get name credit for your commits.

1 Comment

  • GlobalEyes says:

    This generally happens when someone rebases or cherry picks a commit. Git records the author and committer information separately, but we only show both on GitHub if they are different. You can hack it to set them separately like that, but really what you want that data used for is ‘who wrote this’ and ‘who applied this’, like if you submitted a patch to Rails for example, it would show you as the author and the core committer that applied the patch as the committer.

Comments are closed. Would you like to contact the author directly?

Copyright © 2008-2024 Jason Noble's Technical Adventures All rights reserved.
This site is using the Desk Mess Mirrored theme, v2.5, from BuyNowShop.com.