Re: Caution when removing git branches

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: Caution when removing git branches
Дата
Msg-id 20110126163235.GB7172@svana.org
обсуждение исходный текст
Ответ на Caution when removing git branches  (Bruce Momjian <bruce@momjian.us>)
Ответы Re: Caution when removing git branches  (Bruce Momjian <bruce@momjian.us>)
Список pgsql-hackers
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.

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>

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.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patriotism is when love of your own people comes first; nationalism,
> when hate for people other than your own comes first.
>                                       - Charles de Gaulle

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Caution when removing git branches
Следующее
От: Robert Haas
Дата:
Сообщение: Re: [COMMITTERS] pgsql: Remove arbitrary ALTER TABLE .. ADD COLUMN restriction.