If you need to revise your change after the review, edit the files in the same branch you previously created, add them to the Git staging area, and then amend the commit with git codereview change:

$ git codereview change     # amend current commit
(open $EDITOR)
$ git codereview mail       # send new changes to Gerrit
If you need to revise your change after the review, edit the files in the same branch you previously created, add them to the Git staging area, and then amend the commit with git codereview change:

$ git codereview change     # amend current commit
(open $EDITOR)
$ git codereview mail       # send new changes to Gerrit
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
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
To commit changes, instead of git commit, use git codereview change.

$ git codereview change
(open $EDITOR)
Main Go repository:

$ git clone https://go.googlesource.com/go
$ cd go
If you're making a change to the main Go repository:

$ git clone https://go.googlesource.com/go
$ cd go/src
$ ./all.bash                                # compile and test
If you're making a change to one of the golang.org/x/... repositories (golang.org/x/tools, in this example):

$ git clone https://go.googlesource.com/tools
$ cd tools
$ go test ./...                             # compile and test
In a golang.org/x/... repository:

$ go test ./... # recompile and test
Once the change is ready and tested over the whole tree, send it for review. This is done with the mail sub-command which, despite its name, doesn't directly mail anything; it just sends the change to Gerrit:

$ git codereview mail
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...]

Recommend

Go Contribution Guide Sending a change via Gerrit Step 4: Send changes for review

Go Contribution Guide Sending a change via Gerrit Step 3: Test your changes In the golang.org/x/... repositories

Contribution Guide Sending a change via Gerrit Step 3: Test your changes In the main Go repository

Go Contribution Guide Sending a change via Gerrit Step 2: Prepare changes in a new branch

Go Contribution Guide Sending a change via Gerrit Step 1: Clone the source code

Go Contribution Guide Sending a change via Gerrit Overview

Go Contribution Guide Becoming a contributor Step 4: Install the git-codereview command

Contribution Guide Becoming a contributor Step 0: Select a Google Account

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