From: Johannes Sixt Date: Fri, 09 Oct 2009 06:02:44 GMT Subject: Re: combine git repo historically Message-ID: <4ACED204.3000907@viscovery.net> In-Reply-To: <20091009012254.GA3980@debian.b2j> bill lam schrieb: > 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