Suggested Practices for Committers

The following are some useful practices to consider for project committers (and often contributors that are not yet committers), when working with the ASF Git repositories.

Rebasing when Pulling

When working with an single authoritative repository it is not typically necessary to keep track of merge operations that occurred in a committer's clone before changes have been pushed. In that case, it is best to rebase your commits against the latest from the origin before pushing rather than merging.

This would typically look like:

$ git fetch origin
$ git rebase origin/master

To obtain that behavior when using git pull, you can configure it on a per-branch basis:

$ git config branch.master.rebase true

If you would like this to be set for every branch you can use the branch.autosetuprebase option - though note that it won't apply to any existing branches being tracked. To configure this option for all new repositories cloned, you can add it to the global configuration:

$ git config --global branch.autosetuprebase always

Merging should continue to be used when two different branches on the origin need to be merged.