Re: why is git destructive by default? (i suggest it not be!)
- From
Jakub Narebski <jnareb@gmail.com>
- Date
- Jun 24, 2008, 11:22 UTC
- Message-ID
- <200806241322.14224.jnareb@gmail.com>
- In-Reply-To
- <willow-jeske-01l5kwGPFEDjCc7b>
David Jeske wrote:
Show 13 quoted lines
> To re-ask the same question I asked in my last post, using your ascii > pictures... > > > Let's assume we're here.. > > .<---.<---.<---A<---X<---Y <--- master > \ > \--B<---C <--- customer_A_branch <=== HEAD > > > And this person and everyone else moves their head pointers back > to master without merging:
You could simply say: they stop working on 'customer_A_branch' branch (moving HEAD poter is simply switching to / checking out / working on different branch).
Show 15 quoted lines
> .<---.<---.<---A<---X<---Y <--- master <=== HEAD > \ > \--B<---C <--- customer_A_branch > > > Now, five years down the road, our tree looks like: > > > .<---.<---.<---A<---X<---Y<--.(3 years of changes).--ZZZ <--- master <=== HEAD > \ > \--B<---C <--- customer_A_branch > > And someone does: > > git-branch -f customer_A_branch ZZZ
If they are using '-f', i.e. force, they should know and be sure what they are doing; it is not much different from 'rm -f *'.
If reflog for 'customer_A_branch' expired it would be hard to go back to old 'customer_A_branch', and impossible after garbage collector pruned history.
What you _should do_, if you want to preserve old 'customer_A_branch' pointer is to *tag* it, e.g. something like 'Attic/customer_A_branch'; if you use annotated tags you can even state why do you want to keep old work, and why old work wasn't merged into long-lived branch, and why the work was abandoned.
-- Jakub Narebski Poland