How To Create a Great Pull Request in Just 5 Steps
What makes a great pull request?
First of all, congratulations! You have come this far. Creating pull requests is the last step to propose your code to the code owners as well as other contributors.
It is really important to have a great pull request as it would help the reviewers to better understand and learn from your delivered code. For that reason, here are the five steps you could apply to create your next better ones.
1. Branch
Branching means you diverge from the main line of development and continue to do work without messing with that main line.
That way, Git branches are incredibly lightweight, making branching operations nearly instantaneous, and switching back and forth between branches is generally just as fast. — Git document.
A new branch should be created from the latest code of its destination branch from upstream. This means, at the point of branching, the local branch’s HEAD
commit must be the same as the upstream branch’s HEAD
commit.
It will help to make the history of commits in the upcoming pull request clean. In order to do it, if you are using Git command, you could follow these steps:
git fetch --all #1
git checkout…