While you were working, others might have submitted changes to the repository. To update your local branch, run

$ git codereview sync
While you were working, others might have submitted changes to the repository. To update your local branch, run

$ git codereview sync
As part of the review process reviewers can propose changes directly (in the GitHub workflow this would be someone else attaching commits to a pull request). You can import these changes proposed by someone else into your local Git repository. On the Gerrit review page, click the "Download ▼" link in the upper right corner, copy the "Checkout" command and run it from your local Git repo. It will look something like this:

$ git fetch https://go.googlesource.com/review refs/changes/21/13245/1 && git checkout FETCH_HEAD
The same applies to other internal tools of the Go tool chain, such as

$ cd $GODIR/test
$ $GODIR/bin/go run run.go
New files that you contribute should use the standard copyright header:

// Copyright 2022 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
The git-codereview subcommands have been chosen to be distinct from Git's own, so it's safe to define these aliases. To install them, copy this text into your Git configuration file (usually .gitconfig in your home directory):

[alias]
	change = codereview change
	gofmt = codereview gofmt
	mail = codereview mail
	pending = codereview pending
	submit = codereview submit
	sync = codereview sync
Running all.bash for every single change to the code tree is burdensome. Even though it is strongly suggested to run it before sending a change, during the normal development cycle you may want to compile and test only the package you are developing.

$ cd <MYPROJECTDIR>
$ $GODIR/bin/go test
If you see something like...

remote: Processing changes: refs: 1, done
remote:
remote: ERROR:  In commit ab13517fa29487dcf8b0d48916c51639426c5ee9
remote: ERROR:  author email address XXXXXXXXXXXXXXXXXXX
remote: ERROR:  does not match your user account.
you need to configure Git for this repository to use the e-mail address that you registered with. To change the e-mail address to ensure this doesn't happen again, run:

$ git config user.email email@address.com
Then change the commit to use this alternative e-mail address with this command:

$ git commit --amend --author="Author Name <email@address.com>"
Then retry by running:

$ git codereview mail

Recommend

Go Contribution Guide Miscellaneous topics Specifying a reviewer / CCing others

Go Contribution Guide Miscellaneous topics Quickly testing your changes

Go Contribution Guide Miscellaneous topics Troubleshooting mail errors

Go Contribution Guide Miscellaneous topics Copyright headers

Contribution Guide Good commit messages

Go Contribution Guide Sending a change via Gerrit Step 5: Revise changes after a review

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