Basic Git repository configuration

Configure user name and email

When creating a commit in Git the author's name and email address are included. You can either configure this globally for all your Git repositories,

git config --global "John Example" 
git config --global ""

or locally only for the current repository:

git config --local "John Example" 
git config --local ""

Make sure that for the use with Gerrit you have an email address configured that is also known to Gerrit. You can add email addresses to your Gerrit account using Settings->Contact Information->Register New Email...
A mail with a confirmation link will be sent to the address you specified.

Additional configuration

Color for diff, status & co

Enable color for several commands:

git config --global color.diff auto
git config --global color.status auto
git config --global color.branch auto
git config --global color.interactive auto


If you like short commands you can create Git aliases, e.g.:

git config --global checkout

Instead of git checkout you can then use git co.

It may also be useful to define some bash aliases or functions to simplify the use of Git. Michel Krämer has published some useful aliases on GitHub.