Re: incorporating the past
- From
Junio C Hamano <junkio@cox.net>
- Date
- Apr 9, 2007, 19:59 UTC
- Message-ID
- <7vejmtz5dd.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <87d52d1kli.fsf@mid.thomas-huehn.de>
Thomas Hühn <newsgroups@thomas-huehn.de> writes:
Show 6 quoted lines
> Can I just do another git init for 0.1, commit the changes up to 1.0 and > merge those two histories? Don't I need a common ancestor for both or > something like that? > > Or can I do the same, only up to 0.9 instead of 1.0, and then "sew > together" those histories?
Yes. you can "graft" two distinct histories together.
You already have v1.0..v1.6 history. You create v0.1..v0.9 history the same way, perhaps in a separate repository.
Then, you tell git to pretend that the v1.0, which in reality does not have any parent (i.e. "git cat-file commit v1.0" does not have any "parent" line), has one parent that is v0.9, by creating a file .git/info/grafts. The file should list two commit object names (v1.0 first and then v0.9) separated with a single SP and then terminated with a single LF. Each line of this file says "this commit (the first one on the line) has the following parents (the rest)".