Re: Caution when removing git branches - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: Caution when removing git branches
Date
Msg-id 201101261642.p0QGg0a21147@momjian.us
Whole thread Raw
In response to Re: Caution when removing git branches  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-hackers
Martijn van Oosterhout wrote:
-- Start of PGP signed section.
> On Wed, Jan 26, 2011 at 11:26:04AM -0500, Bruce Momjian wrote:
> > For those of you using git, I wanted to point out that it is fairly easy
> > to remove git branches.  For example, I can easily remove a branch on
> > my github repository using:
> > 
> >     $ git branch -d :branch_name
> > 
> > I don't believe that is revertable.  What is scarey is that this could
> > be done on our 'origin' as well.
> 
> Note: -d only works if the branch is considered "fully merged". You
> need -D to override that check.

Right, but if I had done 'git merge origin', I could use -d, right?

> Also, it is revertable, sort of. If you know the commit ID it was, you
> can:
> 
> $ git checkout <commit-id>
> $ git branch <branchname>
> $ git checkout <branchname>

Oh, so the commit-id identifies the branch too.

> This will work as long as "git gc" hasn't been run since the delete. If
> it's referenced from somewhere else then it will work even after
> garbage collection.

OK.  What happens if :master is deleted?  (I don't want to try it, even
on my github).

--  Bruce Momjian  <bruce@momjian.us>        http://momjian.us EnterpriseDB
http://enterprisedb.com
 + It's impossible for everything to be true. +


pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: Caution when removing git branches
Next
From: Robert Haas
Date:
Subject: Re: Caution when removing git branches