From: Daniel Barkalow Date: Tue, 13 Sep 2005 16:23:37 GMT Subject: Re: deleting a branch Message-ID: In-Reply-To: <7v4q8p3qd8.fsf@assigned-by-dhcp.cox.net> On Tue, 13 Sep 2005, Junio C Hamano wrote: > "rm -f .git/refs/heads/no-longer-needed". Make sure your > working tree is not on that branch (i.e. .git/HEAD should not be > pointing at it). > > I have not introduced "git branch -d no-longer-needed" because > I think that should do a bit more than "rm -f". For example: > > - making sure you are not on that branch (obvious), > > - check if all changes on that branch are included in the > master branch or some other branch (easy if we hardcode "master"; > checking all other branches might be nicer but expensive). You could check HEAD. I think the most common cases would either be that you just created a branch from HEAD and changed your mind, or that you've just merged the branch into something. Other that that, I think the common case is that you've made patches, sent them off, and they were accepted. In the first two, you're probably on the branch that includes or matches the one you're deleting; on the third, we want user confirmation, since it's external to the system. -Daniel *This .sig left intentionally blank*