Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pull requests merged manually after a rebase don't show as merged on Github

In order to keep a linear history, I use the following approach to merge changes instead of relying on github's merge functionality:

git checkout -b feature_x user/feature_x
git rebase master                           
git checkout master
git merge --no-ff feature_x
git push origin master                       # On Github: PR gets merged and closed
git branch -D feature_x

The above works perfectly fine but in cases when I have to manually resolve conflicts, the PR doesn't show up as merged on Github automatically and I have to manually close the PR.

Is there a better approach to merging the pull requests that automatically shows Github PRs merged and closed?

like image 656
mandark Avatar asked Jan 02 '15 10:01

mandark


1 Answers

As onlythefinestwilldo has rightly pointed out, once a branch is rebased, it contains a different set of commits which means that the original pull request will not be affected.

To overcome this problem, we have changed our process: now, we do not rebase branch when merging the changes to master. If the changes can't be merged, the creator of the pull request is asked to rebase their branch and update the pull request. Though inconvenient, this is the only way to make sure that the pull requests automatically get closed when merged.

like image 123
mandark Avatar answered Sep 23 '22 04:09

mandark