Open shalomb opened 7 years ago
You can also clean up the feature branch from within the gitflow workflow. This also cleans up the references in your git config.
git flow feature delete 2-integrate-evm-ansible-bootstrap
Thanks @jbinnography - I hadn't realized feature delete
existed as a feature :)
Appears that the fix for our use-case is to set keepremote
git config gitflow.feature.finish.keepremote true
git flow
then does not bomb out when doing a git flow feature finish blah
, though a (useful) complaint is still present at the top of the message.
f/add-wuff $ git flow feature finish add-wuff
fatal: Couldn't find remote ref feature/add-wuff
Fatal: Could not fetch feature/add-wuff from origin.
Branches 'develop' and 'origin/develop' have diverged.
And local branch 'develop' is ahead of 'origin/develop'.
Switched to branch 'develop'
Your branch is ahead of 'origin/develop' by 1 commit.
(use "git push" to publish your local commits)
fatal: The remote end hung up unexpectedly
Already up-to-date.
Deleted branch feature/add-wuff (was b4e8e1e).
Summary of actions:
- The feature branch 'feature/add-wuff' was merged into 'develop'
- Feature branch 'feature/add-wuff' has been locally deleted; it is still remotely available on 'origin'
- You are now on branch 'develop'
As I believe I have a solution that works, this issue can be closed.
As I believe I have a solution that works, this issue can be closed.
@shalomb, Being that you are the ticket's reporter you should be able to close it yourself. :wink:
I was under the impression this was resolved with
gitflow.feature.finish.keepremote true
but this is no longer the case
$ git config gitflow.feature.finish.keepremote true
$ git config gitflow.feature.finish.keepremote
true
$ git flow feature finish
fatal: Couldn't find remote ref feature/lnrg-link-resolution
Fatal: Could not fetch feature/lnrg-link-resolution from origin.
fatal: The remote end hung up unexpectedly
damn :|
For now, I'm having to do explicitly delete the feature
locally.
$ git flow feature delete -f lnrg-link-resolution
@shalomb hi friend, I was studying about git flow to possibly adopt in the company where I work, and I had the same problem, it tries to delete the remote branch but as it is already deleted it generates an error.
This issue is open, meaning nothing has been implemented to fix it yet, do you know why gitflow.feature.finish.keepremote true
doesn't work?
Thanks.
This relates to #264 and is perhaps the same issue.
We use GitLab merge-requests (organizational requirement) where the remote branch is automatically closed when the merge request is completed.
If, however, you attempt to close a
feature
branch that has already been merged, you encounter this fatal error.And the only way then is to delete the feature branch using git outside of the gitflow workflow. I suspect this would be the case for other types of branches too (
hotfix
,release
,support
, etc).The issue is not present in nvie/gitflow.