From: Jeff King Date: Sat, 04 Dec 2010 05:33:04 GMT Subject: Re: Splitting up a repository Message-ID: <20101204053304.GA7311@sigill.intra.peff.net> In-Reply-To: <4CF9D15D.7090001@cs.wisc.edu> On Fri, Dec 03, 2010 at 11:27:57PM -0600, Evan Driscoll wrote: > Say I have a repo where there are directories repo/foo, repo/bar, > repo/baz. 'foo', 'bar', and 'baz' are loosely related -- closely enough > that I put them together initially, but loosely enough that I now wish I > could check out just 'repo/foo'. Since Git doesn't support partial > checkouts (a bit annoying!), I now have to split this repository into > separate ones. I'd of course like to keep history. > > Is there a better way than making several (recursive) copies of the > repository, deleting all but one directory in each copy, then moving the > contents of that directory up a level? (And perhaps setting up a Git > superproject at the original location. I do know about that.) Rewrite the history of each directory with git-filter-branch. It even has a "--subdirectory-filter" option that will do exactly what you want. -Peff