How to create a new PR(pull request) in GIT


There are many ways to do it with various tools available. In this post, i will explain how to create a PR(pull request) using GitHub Desktop and Github GUI. Assuming remote repository is already configured.

  1. Create a branch in GitHub Desktop(Branch->New Branch). You can notice that the current branch is changed to the newly created branch in your GitHub Desktop. For example, you have created sample-changes branch

  2. Perform the changes to the code

  3. Commit the changes to newly created branch sample-changes in GitHub Desktop and publish the branch to Git Repository.

  4. Now, Go to Github GUI and you can notice that the newly commited branch code will be shown under Your recently pushed branches:

  5. Click on compare & pull request

  6. Change the base: to the branch you want to commit this code to and change the compare: to newly created branch. For example, you want to commit the code to develop branch. Then base: develop <- compare:sample-changes

  7. Provide description and assign the reviewer and other information and then create pull request.

  8. Your reviewer will get notified about the PR and then merge your code after reviewing.