Launched a new PR (pull request) easier, you can click on the page, pay attention to choose a good target branch.
Next, will enter the stage of review, this stage may be more lengthy, review the comments and revise your commit, even reply
In this long stage, to merge the PR branch target may turn has a lot of submission, even if your PR is review by, and things to resolve conflicts is a troublesome, you can choose on a similar web-site through GitHub modify the conflict (if less conflict or can), is another way to resolve the conflict in the local (IDE's help) and then push up.
Next, tell us about the PR in the long stage, how to keep the code with minimal conflict situations, and keep the number of commit only one (a lot of people commit only a requirement of PR)
For example, his branch is feature/test
the target branch isdev
To ensure that local
feature/test
anddev
branch codes are up to dateSwitch to
feature/test
branch execution
git rebase dev
- After manually resolve the conflict, the implementation of
git add .
Used to mark a file conflict has been resolved.
-
git status
Look, if files are green, you can continue to rebase
git rebase --continue
Let rebase to continue. If a conflict still occurs, perform steps 3 and 4 again.
- If you need to commit to the number of compressed into one, I choose here to use reset
git reset --soft [commit-id]
Here [commit-id] refers feature/test
and dev
the branch common parent node.
- And then perform a commit
git commit -m "just test"
- All goes well, the implementation of push (need strong push)
git push -f origin feature/test
Repeating the above steps, it is possible to spend a long PR review stage until the final success of merge to the target branch.
Reproduced in: https: //www.jianshu.com/p/7020c8fc3321