From: Stefan Beller <stefanbeller@googlemail.com>
To: GIT Mailing-list <git@vger.kernel.org>
Subject: How to delete all merged branches?
Date: Sun, 16 Feb 2014 18:37:12 +0100 [thread overview]
Message-ID: <5300F748.2060805@googlemail.com> (raw)
Hi,
so I tend to accumulate lots of branches as I'd do one
branch per feature. When cleaning up, I'd like to
delete all branches, which have been merged.
I could use
$ git branch -d (which was merged already?) ^C
$ git branch --merged # let's find out
...
$ # Now run git branch -d with each of the branches.
This kind of question has already been discussed,
http://stackoverflow.com/questions/6127328/how-can-i-delete-all-git-branches-which-are-already-merged
suggests:
git branch --merged | grep -v "\*" | xargs -n 1 git branch -d
Now it seems as if this operation would be needed by quite a few people
actually. Maybe it's time to integrate into git? I'd be interested, which
way would be the most git-like way to do it.
I could think of:
$ git branch -d --merged # no need to specifiy a branch iff --merged is given with -d
$ git branch --delete-merged # comes as an new extra option, doesn't clutter other commands
$ git branch -d keyword-for-all-merged-branches
Before starting such a feature, I'd like to hear input of others.
Thanks,
Stefan
next reply other threads:[~2014-02-16 17:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-16 17:37 Stefan Beller [this message]
2014-02-16 19:17 ` How to delete all merged branches? Jamie Couture
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5300F748.2060805@googlemail.com \
--to=stefanbeller@googlemail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.