How to Set Commit Author

By  on  

I've worn dozens of hats on a dozen different teams during my time at Mozilla, but none has been as rewarding and challenging as community management. Whether it's mentoring students, welcoming new contributors, or reviewing pull requests, there's always so much to be done. There's also the rare occasion where I need to submit a patch for a contributor.

Since I work with both git and mercurial (hg), I've needed to learn how to set commit author in each version control system.

To set the commit author with git, you would execute:

git commit --author="User Name <username@domain.com>" -m "The commit message"

To set the commit author with mercurial, you would execute:

hg commit -u "User Name <username@domain.com>" -m "The commit message"

Giving community members credit for their patches is the ultimate sign of respect, so in the case you need to translate those patches for a contributor, these snippets are gold. Help them help you!

Recent Features

  • By
    Camera and Video Control with HTML5

    Client-side APIs on mobile and desktop devices are quickly providing the same APIs.  Of course our mobile devices got access to some of these APIs first, but those APIs are slowly making their way to the desktop.  One of those APIs is the getUserMedia API...

  • By
    CSS vs. JS Animation: Which is Faster?

    How is it possible that JavaScript-based animation has secretly always been as fast — or faster — than CSS transitions? And, how is it possible that Adobe and Google consistently release media-rich mobile sites that rival the performance of native apps? This article serves as a point-by-point...

Incredible Demos

Discussion

    Wrap your code in <pre class="{language}"></pre> tags, link to a GitHub gist, JSFiddle fiddle, or CodePen pen to embed!