I am working on some technical verification.
Suppose, I am working on feature branch. I have created a pull request from the feature branch to the master branch and already have a series of commit.
I have started working on my git-bash and let's say I have added a commit M
but have not pushed it to my feature branch.
After that, I have used the merge command to merge and close my pull request.
The interesting thing is: my pull request will not show any account of commit M
, but on my master
branch, this commit M
will be pushed.
How do I verify if the number of commit in the pull request is same as in the master branch, using the GitHub API?
The above image show that I have added the feature one commit to my pull request.
The above image shows that when I have used the merge command, to merge my feature-branch, I have added two commits on my master
branch.
Git log
CodePudding user response:
but on my master branch, this commit M will be pushed.
It should not be pushed, unless you have locally created M
on master
, instead of your local feature branch.
From your logs, you have merged feature2
on master
locally, and then push, which is not indeed the normal workflow.
(Normally, you push the updated feature2
, which update your PR in progress)
You can use, as described here, the compare URL of the compare commits API, to compare feature2
and origin/feature2
, and check for differences.