[lfs-dev] LFS and Git

Kevin Lyda kevin at ie.suberic.net
Mon Mar 10 03:49:29 PDT 2014

On Mon, Mar 10, 2014 at 9:40 AM, Pierre Labastie
<pierre.labastie at 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


Kevin Lyda
Galway, Ireland
US Citizen overseas? We can vote.
Register now: http://www.votefromabroad.org/

More information about the lfs-dev mailing list