提交 45dca19a 编写于 作者: Y Yu Yang 提交者: backyes

Change contribute to paddle to fit new branching model (#275)

* Change contribute to paddle to fit new branching model
上级 cbe734b3
...@@ -4,7 +4,7 @@ We sincerely appreciate your contributions. You can use fork and pull request ...@@ -4,7 +4,7 @@ We sincerely appreciate your contributions. You can use fork and pull request
workflow to merge your code. workflow to merge your code.
## Code Requirements ## Code Requirements
- Your code mush be fully documented by - Your code must be fully documented by
[doxygen](http://www.stack.nl/~dimitri/doxygen/) style. [doxygen](http://www.stack.nl/~dimitri/doxygen/) style.
- Make sure the compiler option WITH\_STYLE\_CHECK is on and the compiler - Make sure the compiler option WITH\_STYLE\_CHECK is on and the compiler
passes the code style check. passes the code style check.
...@@ -20,16 +20,30 @@ It's just that simple. ...@@ -20,16 +20,30 @@ It's just that simple.
## Clone ## Clone
Paddle is currently using [git-flow branching model](http://nvie.com/posts/a-successful-git-branching-model/).
The **develop** is the main branch, and other user's branches are feature branches.
Once you've created a fork, you can use your favorite git client to clone your Once you've created a fork, you can use your favorite git client to clone your
repo or just head straight to the command line: repo or just head straight to the command line:
```shell ```shell
# Clone your fork to your local machine # Clone your fork to your local machine
git clone https://github.com/USERNAME/Paddle.git git clone --branch develop https://github.com/USERNAME/Paddle.git
```
If your repository doesn't contain **develop** branch, just create it by your own.
```shell
git clone https://github.com/USERNAME/Paddle.git Paddle
cd Paddle
git checkout -b develop # create develop branch.
git remote add upstream https://github.com/baidu/Paddle.git # add upstream to baidu/Paddle
git pull upstream develop # update to upstream
``` ```
Then you can start to develop by making a local developement branch Then you can start to develop by making a local developement branch
```shell ```shell
git checkout -b MY_COOL_STUFF_BRANCH origin/master git checkout -b MY_COOL_STUFF_BRANCH
``` ```
## Commit ## Commit
...@@ -41,7 +55,7 @@ Commit your changes by following command lines: ...@@ -41,7 +55,7 @@ Commit your changes by following command lines:
git status git status
# add modified files # add modified files
git add xx git add xx
git commit -m "commit info" env EDITOR=vim git commit # You can write your comments by vim/nano/emacs.
``` ```
The first line of commit infomation is the title. The second and later lines The first line of commit infomation is the title. The second and later lines
are the details if any. are the details if any.
...@@ -63,7 +77,7 @@ git remote -v ...@@ -63,7 +77,7 @@ git remote -v
Update your fork with the latest upstream changes: Update your fork with the latest upstream changes:
```shell ```shell
git pull --rebase upstream HEAD git pull --rebase upstream develop
``` ```
If there are no unique commits locally, git will simply perform a fast-forward. If there are no unique commits locally, git will simply perform a fast-forward.
...@@ -76,7 +90,7 @@ Now, your local master branch is up-to-date with everything modified upstream. ...@@ -76,7 +90,7 @@ Now, your local master branch is up-to-date with everything modified upstream.
```shell ```shell
# push to your repository in Github # push to your repository in Github
git push origin HEAD git push -u origin MY_COOL_STUFF_BRANCH # create remote branch MY_COOL_STUFF_BRANCH to origin.
``` ```
## Pull Request ## Pull Request
...@@ -93,13 +107,24 @@ of conflict, you need to do the update manually. You need to do the following on ...@@ -93,13 +107,24 @@ of conflict, you need to do the update manually. You need to do the following on
your local repository: your local repository:
```shell ```shell
git checkout MY_COOL_STUFF_BRANCH git checkout MY_COOL_STUFF_BRANCH
git pull --rebase upstream HEAD git pull upstream develop
# You may need to resolve the conflict according to the git prompt. # You may need to resolve the conflict according to the git prompt.
# Make and test your code. # Make and test your code.
git push -f origin HEAD git push origin MY_COOL_STUFF_BRANCH
``` ```
Now your Pull Request is updated with the latest version. Now your Pull Request is updated with the latest version.
## Revise your pull request ## Revise your pull request
When you revise your pull request according to reviewer's comments, please use 'git commit' instead of 'git commit --amend' to commit your changes so that the reviewers can see the difference between the new pull requrest and the old pull request. When you revise your pull request according to reviewer's comments, please use 'git commit' instead of 'git commit --amend' to commit your changes so that the reviewers can see the difference between the new pull requrest and the old pull request.
The possible commands are
```shell
git checkout MY_COOL_STUFF_BRANCH
git pull upstream develop # update local to newest code base.
# May be some conflicts will occured.
# And develop your cool stuff
env EDITOR=vim git commit # add your revise log
git push origin MY_COOL_STUFF_BRANCH
```
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册