Re: combine git repo historically
- From
Johannes Sixt <j.sixt@viscovery.net>
- Date
- Oct 9, 2009, 06:02 UTC
- Message-ID
- <4ACED204.3000907@viscovery.net>
- In-Reply-To
- <20091009012254.GA3980@debian.b2j>
bill lam schrieb:
Show 14 quoted lines
> I have two git repos, no branches. > > repo 1. > emptyrootcommit -- A ... M > > repo 2. > emptyrootcommit -- N ... Z > > N was evolved from M but the time gap is large, how can I combine them > into one repo > > emptyrootcommit -- A ... M -- N ... Z > > so that snapshots N .. Z will not be changed.
$ echo $(git rev-parse N) $(git rev-parse M) >> .git/info/grafts $ git filter-branch --tag-name-filter cat -- --all --not M
i.e. you graft the older history right before the younger history, then you use git filter-branch to rewrite the parentship of the younger commits.
-- Hannes