Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Github pull request issue

Tags:

git

github

I have the following scenario:

  • my Github default branch is "develop"
  • I have three pull request for the "develop" branch
  • 3 pull requests are build and verified ok (by CI server)
  • then one pull request is manually merged to "develop". '$ bumpversion --commit dev' is executed automatically and the version is build and released. Consequently all files that contain the version change on "develop" (.bumpversion.cfg, module/__init__.py)
  • so far so good. Now, due to the changes in "develop" the remaining two pull requests become invalid and can not be merged via the Github GUI any more. I need to checkout the branch and merge with "develop" like @Anirudha describes in detail.
  • I do not want my pull requests to become invalid by changes to these two files

I am sure the solution is obvious to the git experts who know how to fix this. So far I could not find it, so please share.

like image 521
moin moin Avatar asked Oct 13 '16 07:10

moin moin


Video Answer


2 Answers

All you need to do is, checkout on those pull requests: git checkout PR1

pull the latest the changes on develop branch. git pull origin develop

Review your corresponding changes. and push to your respective PR. The git remote PR gets updated with new changes and your CI will approve accordingly as well.

like image 107
Ani Avatar answered Oct 21 '22 01:10

Ani


I suggest you to do a git rebase for this scenario.

Git Rebase Official Doc

What it does is, checkout to branch you specify while doing a rebase, lets say you have pr#2 and pr#3 pending, You clone the repo and do while in the branch which generated the PR,

git rebase develop

It will say that rebase in prgress, so, you go and solve conflicts in that process, and do a

git add

Now, the rebase either continue or stop if do not have more conflicts. If you have, you can read status in terminal, to continue,

git rebase --continue

Now, do that until all conflicts are resolved.

And finally when you checkout to the branch for that PR, you should see that there are NO conflicts, and branch can be automatically merged (by pushing to remote repo obviously).

Now, repeat the same process for pr#3, and you are done.

In summary,

git rebase develop
git add <files>
git rebase --continue

repeat this for pr#3 also.

like image 21
viral Avatar answered Oct 21 '22 00:10

viral