Author Email

Git commits include name and email address of the author of the patch as well as the person committing the patch. Unless you set up your git client with your email address, your commits will have useless email addresses like "username@localhost.localdomain".

The exact error message you get if you try to push commits without useful email addresses to GNOME repositories is:

The commits you are trying to push contain the author email
address '$email'. Please configure your
username and email address. See:

For instructions about how to do this and how to fix your
existing commits.

Configuring Name/email

To ensure that the history has proper emails, all people making commits should run

git config --global "Your Name Comes Here"
git config --global

on each machine they use git on.

By default git uses your configured user name and email address both as commit and author information. If you are committing a patch written by someone else, you can correctly attribute authorship by using the --author argument of "git commit":

git commit --author 'Author Name <>'

Fixing existing commits

If you have existing (unpushed) commits, which you need to fix, you have several options.

In the case of just needing to fix the last commit

git commit --amend --author 'John Doe <user@domain.tld>'

If there are several commits which you need to fix, options include: use "git rebase --interactive", mark the commits for editing, and amend each one. Or use "git format-patch", edit the patches, and use "git am".

Git/Help/AuthorEmail (last edited 2009-04-24 04:09:53 by BehdadEsfahbod)