git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* How to delete all merged branches?
@ 2014-02-16 17:37 Stefan Beller
  2014-02-16 19:17 ` Jamie Couture
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Beller @ 2014-02-16 17:37 UTC (permalink / raw)
  To: GIT Mailing-list

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-02-16 19:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-16 17:37 How to delete all merged branches? Stefan Beller
2014-02-16 19:17 ` Jamie Couture

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).