Mark Kenny
Mark Kenny

Reputation: 1638

Git Flow GitHub pull request isn't working as expected

I've been using github for a while now where I create feature branches (locally) add commits and then push. Once pushed I perform a pull request with a "develop" branch, once happy, merge the feature branch into the develop branch. This seems pretty much standard practice. I use git flow and this is my standard practice for creating and pushing a feature branch

git flow feature start test
git add . 
git commit -am 'test commit'
git push -u origin feature/test

I then would create a pull request on GH, once merged I run:

git flow feature finish test

Which merges the feature branch back into my develop. Then from my local develop branch:

git pull

And I start the whole process again

For some reason now, when I go to create a PR in Github I get the following:

Pull request message

What exactly does this mean? I can perform git diff between the two branches and I can see my changes locally, also a visual inspection of the two branches on Github shows my changes too.

Upvotes: 1

Views: 1190

Answers (2)

gmedina
gmedina

Reputation: 216

I've got around this by doing this:

git flow feature finish test -k //this will keep the feature branch

Then after merge happens, you should still see the PR still there marker as "merged" instead of "closed". Finally, you can delete the remote feature branch

git flow feature delete test -r

Upvotes: 1

Benjamin
Benjamin

Reputation: 1286

The git flow feature finish test command will:

  1. Merge the feature branch test back into develop
  2. Delete the feature branch
  3. Check out develop

So once you have run the feature finish command, the test branch should no longer exist. This would explain why GitHub is throwing it's hands up ¯\_(ツ)_/¯

Even if GitHub can still find the feature branch, it should be identical to the develop branch at this point which would likely trip GitHub up also.

Source: git-flow cheatsheet

Upvotes: 0

Related Questions