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
    Create a CSS Cube

    CSS cubes really showcase what CSS has become over the years, evolving from simple color and dimension directives to a language capable of creating deep, creative visuals.  Add animation and you've got something really neat.  Unfortunately each CSS cube tutorial I've read is a bit...

  • By
    9 More Mind-Blowing WebGL Demos

    With Firefox OS, asm.js, and the push for browser performance improvements, canvas and WebGL technologies are opening a world of possibilities.  I featured 9 Mind-Blowing Canvas Demos and then took it up a level with 9 Mind-Blowing WebGL Demos, but I want to outdo...

Incredible Demos

  • By
    Create a Simple Slideshow Using MooTools, Part II:  Controls and Events

    Last week we created a very simple MooTools slideshow script. The script was very primitive: no events and no next/previous controls -- just cross-fading between images. This tutorial will take the previous slideshow script a step further by: Adding "Next" and "Previous" controls. Adding...

  • By
    MooTools History Plugin

    One of the reasons I love AJAX technology so much is because it allows us to avoid unnecessary page loads.  Why download the header, footer, and other static data multiple times if that specific data never changes?  It's a waste of time, processing, and bandwidth.  Unfortunately...

Discussion

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