Github — Pull Request (PR)
Pull requests let you tell others about changes you’ve pushed to a GitHub repository. Once a pull request is sent, interested parties can review the set of changes, discuss potential modifications, and even push follow-up commits if necessary. — Github
CREATING A PULL REQUEST
- Make sure that your repository is up to date and a create a brunch form the latest commit on master. You must have changes commited to the new brunch.
git pull origin master
git checkout -b [branch-name]
git push origin [branch-name]
2. Go to the repository on Github and click ‘Pull Request’. Choose the branch you wish to merge. Write title of the PR and comments.
3. Click on ‘Send Pull Request’. You will see an open pull request.
4. As soon as collaborators approved your Pull Request you can merge the changes back to master.
5. LOCALLY: Use command git rerere or git merge to merge the branch to the master. git rerere is preferred if you are working locally and working alone on the branch. git rerere will merge all the commits in one commit and represent entire set of changes, but changed the history and might cause many conflicts. git merge will dublicate conflicts.
ON GITHUB: Click ‘Merge pull request’ or ‘Confirm squash and merge’ (if you have merge squashing enabled).
6. Type commit message and confirm the merge.
7. On the Github click ‘Close’ button on the pull request.
8. Delete the branch.