You also need to make sure that your Git tool is configured to create commits using your chosen e-mail address. You can either configure Git globally (as a default for all projects), or locally (for a single specific project). You can check the current configuration with this command:

$ git config --global user.email  # check current global config
$ git config user.email           # check current local config
To change the configured address:

$ git config --global user.email name@example.com   # change global config
$ git config user.email name@example.com            # change local config
You also need to make sure that your Git tool is configured to create commits using your chosen e-mail address. You can either configure Git globally (as a default for all projects), or locally (for a single specific project). You can check the current configuration with this command:

$ git config --global user.email  # check current global config
$ git config user.email           # check current local config
To change the configured address:

$ git config --global user.email name@example.com   # change global config
$ git config user.email name@example.com            # change local config
If you prefer, there is an automated tool that walks through these steps. Just run:

$ go install golang.org/x/tools/cmd/go-contrib-init@latest
$ cd /code/to/edit
$ go-contrib-init
Install the git-codereview command by running,

$ go install golang.org/x/review/git-codereview@latest
Make sure git-codereview is installed in your shell path, so that the git command can find it. Check that

$ git codereview help
Each Go change must be made in a separate branch, created from the master branch. You can use the normal git commands to create a branch and add changes to the staging area:

$ git checkout -b mybranch
$ [edit files...]
$ git add [files...]
You can edit the commit description in your favorite editor as usual. The git codereview change command will automatically add a unique Change-Id line near the bottom. That line is used by Gerrit to match successive uploads of the same change. Do not edit or delete it. A Change-Id looks like this:

Change-Id: I2fbdbffb3aab626c4b6f56348861b7909e3e8990
After running for a while and printing a lot of testing output, the command should finish by printing,

ALL TESTS PASSED
Gerrit assigns your change a number and URL, which git codereview mail will print, something like:

remote: New Changes:
remote:   https://go-review.googlesource.com/99999 math: improved Sin, Cos and Tan precision for very large arguments
To commit changes, instead of git commit, use git codereview change.

$ git codereview change
(open $EDITOR)

Recommend

Go Contribution Guide Becoming a contributor Overview

Go Diagnostics Debugging

Go Diagnostics Profiling

How to Write Go Code Testing

How to Write Go Code Your first program Importing packages from remote modules

How to Write Go Code Your first program Importing packages from your module

How to Write Go Code Your first program

The Go Programming Language Specification System considerations Size and alignment guarantees

The Go Programming Language Specification System considerations Package unsafe

The Go Programming Language Specification Run-time panics

The Go Programming Language Specification Errors

The Go Programming Language Specification Program initialization and execution Program execution

The Go Programming Language Specification Program initialization and execution Package initialization

The Go Programming Language Specification Program initialization and execution The zero value

The Go Programming Language Specification Packages An example package

The Go Programming Language Specification Packages Import declarations

The Go Programming Language Specification Packages Package clause

The Go Programming Language Specification Packages Source file organization

The Go Programming Language Specification Built-in functions Bootstrapping

The Go Programming Language Specification Built-in functions Handling panics

The Go Programming Language Specification Built-in functions Manipulating complex numbers

The Go Programming Language Specification Built-in functions Deletion of map elements

The Go Programming Language Specification Built-in functions Appending to and copying slices

The Go Programming Language Specification Built-in functions Making slices, maps and channels

The Go Programming Language Specification Built-in functions Allocation

The Go Programming Language Specification Built-in functions Length and capacity

The Go Programming Language Specification Statements Defer statements

The Go Programming Language Specification Statements Fallthrough statements

The Go Programming Language Specification Statements Goto statements

The Go Programming Language Specification Statements Continue statements

The Go Programming Language Specification Statements Break statements

The Go Programming Language Specification Statements Return statements

The Go Programming Language Specification Statements Select statements

The Go Programming Language Specification Statements Go statements

The Go Programming Language Specification Statements For statements For statements with range clause

The Go Programming Language Specification Statements For statements For statements with for clause

The Go Programming Language Specification Statements For statements For statements with single condition

The Go Programming Language Specification Statements For statements

The Go Programming Language Specification Statements Switch statements Type switches

The Go Programming Language Specification Statements Switch statements Expression switches

The Go Programming Language Specification Statements Switch statements

The Go Programming Language Specification Statements If statements