petervanderdoes/gitflow-avh

git flow finish crashes when the remote automatically removes the branch after a merge

Startouf opened this issue · 0 comments

We have configured github to automatically delete the branches after a git PR merge, and we have the habit of opening a PR of our release branch into master (to make sure the build is green), so when doing git flow release finish, github considers the PR as "merged" and will automatically close the release branch, thus generating in git flow an error

# Finish the release, push it and get rid of the branches 
git flow release finish -Fp

error: unable to delete 'release/15.2.0': remote ref does not exist
error: failed to push some refs to 'git@github.com:org/repo.git'

When git flow tries to remove the release branch and push to the repo.

This is a bit similar to #343 but ideally, we'd need to configure git flow to let him know that the remote is supposed to automatically remove the branch after a PR merge (for instance, a git fetch/pull after merging the branch into master), and the only thing left is to delete the local release branch.