petervanderdoes/gitflow-avh

Feature request: feature branch cleanup

djensen47 opened this issue · 3 comments

One of the great things about using gitflow command line tools is that it takes several git commands and bundles them together.

However, as soon as you affect the repo outside of using the command line tools, some of the benefit is lost. The specific situation, which is common, is when you push your feature branch to origin, create a PR, have it reviewed, and then use github to merge (and squash) the PR. The reason why we might do this is to get the nice commit message in the merge that references the PR. Plus most teams are going to be dealing with GitHub directly for PR releated activities.

This brings me to my feature request (if you like the idea, I'm willing to submit a PR). I would like a clean command or flag. It would do everything that finish does but without the merge (because it's already done). Basically just delete the local and remote feature branches.

$ git flow feature clean [feature-name]
or
$ git flow feature finish --no-merge
or 
$ git flow feature finish --delete-only

Thoughts?

It looks like

git flow feature delete --remote does most of what I need

It would still be nice to have a command that resets your dev environment after you've done a squash and merge elsewhere.

  1. git fetch
  2. git flow feature delete --remote
  3. git checkout develop
  4. git pull

I use an alias for this:

alias gbpurge='git branch --merged | grep -v "\*" | grep -v "master" | grep -v "develop" | xargs -n 1 git branch -d'

Prior discussion and alternate proposal: #358