Re: deleting a branch
- From
Junio C Hamano <junkio@cox.net>
- Date
- Sep 13, 2005, 16:05 UTC
- Message-ID
- <7v4q8p3qd8.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <4326F2AE.50108@citi.umich.edu>
Chuck Lever <cel@citi.umich.edu> writes:
> a couple of newbie questions. > > 1. how do i delete a branch?
"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).
- otherwise tell the user this and that changes will be forever lost and get a confirmation before removing.
> 2. is there a conventional place where branch description files reside?
No, but somebody proposed a convention a couple of days ago.