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.
-
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-changesbranch -
Perform the changes to the code
-
Commit the changes to newly created branch
sample-changesin GitHub Desktop and publish the branch to Git Repository. -
Now, Go to Github GUI and you can notice that the newly commited branch code will be shown under
Your recently pushed branches: -
Click on
compare & pull request -
Change the
base:to the branch you want to commit this code to and change thecompare:to newly created branch. For example, you want to commit the code todevelopbranch. Thenbase: develop<-compare:sample-changes -
Provide description and assign the reviewer and other information and then create pull request.
-
Your reviewer will get notified about the PR and then merge your code after reviewing.