Skip to content

Commit

Permalink
Polish doc best-practice-pull-request
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouxinyu committed Dec 27, 2016
1 parent a4ed6d3 commit 2e6e3f6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions _docs/06-best-practice-pull-request.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ There are several ways to setup Git for committers and contributors. Contributor

{% include toc %}

# Git setup for Committers
# Git setup for Contributors
This describes setup for one local repo and two remotes. It allows you to push the code on your machine to either your Github repo or to git-wip-us.apache.org. You will want to fork github's apache/incubator-rocketmq to your own account on github, this will enable Pull Requests of your own. Cloning this fork locally will set up "origin" to point to your remote fork on github as the default remote. So if you perform "git push origin master" it will go to github.

To attach to the apache git repo do the following:
Expand Down Expand Up @@ -61,9 +61,9 @@ Merging pull requests are equivalent to a "pull" of a contributor's branch:

git checkout master # switch to local master branch
git pull apache master # fast-forward to current remote HEAD
git pull --squash https://github.com/cuser/incubator-rocketmq.git cbranch # merge to master
git pull --squash https://github.com/cuser/incubator-rocketmq.git ROCKETMQ-xxxx # merge to master

--squash ensures all PR history is squashed into single commit, and allows committer to use his/her own message. Read git help for merge or pull for more information about --squash option. In this example we assume that the contributor's Github handle is "cuser" and the PR branch name is "cbranch". Next, resolve conflicts, if any, or ask a contributor to rebase on top of master, if PR went out of sync.
--squash ensures all PR history is squashed into single commit, and allows committer to use his/her own message. Read git help for merge or pull for more information about --squash option. In this example we assume that the contributor's Github handle is "cuser" and the PR branch name is "ROCKETMQ-xxxx". Next, resolve conflicts, if any, or ask a contributor to rebase on top of master, if PR went out of sync.

If you are ready to merge your own (committer's) PR you probably only need to merge (not pull), since you have a local copy that you've been working on. This is the branch that you used to create the PR.

Expand Down

0 comments on commit 2e6e3f6

Please sign in to comment.