git flow feature finish not deleting remote feature branch by default

1,389 views
Skip to first unread message

AD7six

unread,
Feb 15, 2012, 6:15:42 AM2/15/12
to gitflow-users
Hi,

I've been using git-flow now for some time, one thing that I haven't
quite managed to figure out though, is why `git flow feature finish`
does not delete a remote feature branch by default.

feature-finish deletes the remote branch if -F is passed:
https://github.com/nvie/gitflow/blob/develop/git-flow-feature#L260
https://github.com/nvie/gitflow/blob/develop/git-flow-feature#L343

It isn't really intuitive imo that fetch means "delete remote branch"
when used with the finish command, but that looks like the only way
gitflow does it for the user - the "summary of actions" does not list
deleting the remote in this circumstance though.

Most of the time though there's only one user working in a feature
branch (at least, IME, and even if there is more than one developer
the lead is the only one that's going to execute feature-finish). If a
feature branch has a remote tracking branch, it would seem logical to
delete the remote at the same time.

Or, perhaps, have a separate command for cleaning up already merged
branches similar to http://devblog.springest.com/a-script-to-remove-old-git-branches

Am I missing something obvious - is the reason my current team has 30
remote feature branches which were published for review and are now
already merged to develop an indication of misuse of git flow?

Cheers,

AD

Brian Kotek

unread,
Feb 15, 2012, 11:40:35 AM2/15/12
to gitflo...@googlegroups.com
You're not alone, I have asked myself the same question. Seems like finishing a feature should remote the remote branch.

Mark Derricutt

unread,
Feb 15, 2012, 11:16:19 PM2/15/12
to gitflo...@googlegroups.com
Originally gitflow enforced remote operations on EVERYTHING, which really broke things if you were using git-svn or didn't actually have a remote origin server ( local git repository only ).

So now it's an optional thing.  Altho, having that configurable inside ./git/config might be nice.

Mark

--
"Great artists are extremely selfish and arrogant things" — Steven Wilson, Porcupine Tree

Brian Kotek

unread,
Feb 15, 2012, 11:33:48 PM2/15/12
to gitflo...@googlegroups.com
By optional, what do you mean? Is there a way to set it up so finish does remove the remote branch?

Thanks,

Brian

AD7six

unread,
Feb 17, 2012, 5:01:38 AM2/17/12
to gitflow-users
As a follow up,

Since I'd like to have this, I started working on automatically
deleting remote branches, and cleaning up already-completed features

https://github.com/AD7six/gitflow/tree/feature/feature-cleanup

Cheers,

AD
Reply all
Reply to author
Forward
0 new messages