GitHub Pull Request Showing Commits which are already on the Target Branch

in #india7 years ago

It happens with me sometimes that if I have created a Pull Request which is merged and if I try to create another Pull Request, the commits made in the first Pull Request still shows. Though the code changes in the pull request did not appear, the commits show. For me whenever I create a Pull Request I always check the commits first made only in that Pull Request, so I wanted a way to fix that.

I have an option of Rebase though which technically GitHub should do whenever the Pull Request is merged. But the problem with rebase is that you need to create an extra commit and I usually want to keep my commits as minimum and meaningful as possible.

So what I actually do is to run the below commands which delete the branch from Local as well as Remote and then merged the branch from the Remote Repository.

git push --delete origin develop
git checkout master
git branch -D develop
git checkout -b develop
git fetch upstream
git merge upstream/develop
git push origin develop

I know its not the best solution but it works in my case to keep my Pull Request as clean as possible.

Sort:  

Thank you so much for participating in the Partiko Delegation Plan Round 1! We really appreciate your support! As part of the delegation benefits, we just gave you a 3.00% upvote! Together, let’s change the world!

Hi @codingdefined!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your UA account score is currently 5.217 which ranks you at #843 across all Steem accounts.
Your rank has improved 4 places in the last three days (old rank 847).

In our last Algorithmic Curation Round, consisting of 227 contributions, your post is ranked at #195.

Evaluation of your UA score:
  • You've built up a nice network.
  • The readers like your work!
  • Try to work on user engagement: the more people that interact with you via the comments, the higher your UA score!

Feel free to join our @steem-ua Discord server

Coin Marketplace

STEEM 0.05
TRX 0.33
JST 0.079
BTC 62772.23
ETH 1680.01
USDT 1.00
SBD 0.47