This section contains some frequently asked questions and tips for troubleshooting problems in your code contribution.
Change to the root of your
$ cd docker-fork
user.name for the repository.
$ git config --local user.name "FirstName LastName"
user.email for the repository.
$ git config --local user.email "email@example.com"
Set your local repo to track changes upstream, on the
Change to the root of your Docker repository.
$ cd docker-fork
Add a remote called
upstream that points to
$ git remote add upstream https://github.com/docker/docker.git
gofmt -s -w filename.go on each changed file before committing your changes.
Most editors have plug-ins that do the formatting automatically.
Sync and cleanly rebase on top of Docker’s
master; do not mix multiple branches
in the pull request.
Squash your commits into logical units of work using
git rebase -i and
git push -f.
If your code requires a change to tests or documentation, include code,test, and documentation changes in the same commit as your code; this ensures a revert would remove all traces of the feature or fix.
Reference each issue in your pull request description (
The Go blog wrote about code comments, it is a single page explanation. A summary follows:
Always rebase and squash your commits before making a pull request.
Fetch any of the last minute changes from
$ git fetch upstream master
Start an interactive rebase.
$ git rebase -i upstream/master
Rebase opens an editor with a list of commits.
pick 1a79f55 Tweak some of images pick 3ce07bb Add a new line
If you run into trouble,
git --rebase abort removes any changes and gets you
back to where you started.
pick keyword with
squash on all but the first commit.
pick 1a79f55 Tweak some of images squash 3ce07bb Add a new line
After closing the file,
git opens your editor again to edit the commit
Edit and save your commit message.
$ git commit -s
Make sure your message includes your signature.
Push any changes to your fork on GitHub, using the
-f option to
force the previous change to be overwritten.
$ git push -f origin my-keen-feature