Skip to content

Commit 425e5b0

Browse files
emailweixureyoung
authored andcommitted
Instructions for update pull request (#84)
1 parent 159dd83 commit 425e5b0

File tree

1 file changed

+24
-6
lines changed

1 file changed

+24
-6
lines changed

doc/build/contribute_to_paddle.md

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,12 @@ repo or just head straight to the command line:
2525

2626
```shell
2727
# Clone your fork to your local machine
28-
git clone [email protected]:USERNAME/Paddle.git
28+
git clone https://github.com/USERNAME/Paddle.git
29+
```
30+
Then you can start to develop by making a local developement branch
31+
```shell
32+
git checkout -b MY_COOL_STUFF_BRANCH origin/master
2933
```
30-
Then you can start to develop.
3134

3235
## Commit
3336

@@ -45,7 +48,7 @@ are the details if any.
4548

4649
## Keeping Fork Up to Date
4750

48-
Before pull your request, you shold sync you code from the latest PaddlePaddle.
51+
Before pull your request, you should sync your code from the latest PaddlePaddle.
4952
To do this, you'll need to add a remote at first:
5053

5154
```shell
@@ -60,8 +63,7 @@ git remote -v
6063
Update your fork with the latest upstream changes:
6164

6265
```shell
63-
git fetch upstream
64-
git pull upstream master
66+
git pull --rebase upstream HEAD
6567
```
6668

6769
If there are no unique commits locally, git will simply perform a fast-forward.
@@ -74,10 +76,26 @@ Now, your local master branch is up-to-date with everything modified upstream.
7476

7577
```shell
7678
# push to your repository in Github
77-
git push origin master
79+
git push origin HEAD
7880
```
7981

8082
## Pull Request
8183

8284
Go to the page for your fork on GitHub, select your development branch,
8385
and click the **pull request button**.
86+
87+
## Update your pull request with the lastest version
88+
89+
During the code review, your pull request may become stale because new commits in
90+
baidu/Paddle. GitHub allows autmotic update if there is no conflict. You can do this
91+
by clicking the "Update Branch" button in your pull request page. However, in the case
92+
of conflict, you need to do the update manually. You need to do the following on
93+
your local repository:
94+
```shell
95+
git checkout MY_COOL_STUFF_BRANCH
96+
git pull --rebase upstream HEAD
97+
# You may need to resolve the conflict according to the git prompt.
98+
# Make and test your code.
99+
git push -f origin HEAD
100+
```
101+
Now your Pull Request is updated with the latest version.

0 commit comments

Comments
 (0)