On Mon, Mar 10, 2014 at 9:40 AM, Pierre Labastie
<pierre.labas...@neuf.fr> wrote:
>   Q: Hmm. OK. And how do I get rid of my branch?
>   A: git branch -d my_branch

Only if the commit that branch points to is in another branch/tag. To
delete it if it would be unreferenced: git branch -D my_branch

>   Q: OK. And how do I get rid of a distant branch?
>   A: git push origin :my_branch
>   Errr...

That was true. But in newer versions of git: git push --delete my_branch

BTW, if you ever wonder if a given commit is in a branch/tag, just do:

git branch --contains commit-id
git tag --contains commit-id

So in the first question above, if

git branch --contains my_branch

only returned "my_branch" it would mean that the commit would be
orphaned and git branch -d would exit with a warning and w/o doing
anything.

Kevin

-- 
Kevin Lyda
Galway, Ireland
US Citizen overseas? We can vote.
Register now: http://www.votefromabroad.org/
-- 
http://linuxfromscratch.org/mailman/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to