git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Splitting up a repository

From
EDEvan Driscoll <driscoll@cs.wisc.edu>
Date
Dec 4, 2010, 05:27 UTC
Message-ID
<4CF9D15D.7090001@cs.wisc.edu>

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.)

I've probably spent more time typing up this email than it would take to do, but I'm curious if there's some git magic or something that would be better for some reason. :-)

Evan
Next: Jeff King
Message 1 of 6 in “Splitting up a repository”
  1. Evan DriscollDec 4, 2010
  2. Jeff KingDec 4, 2010
  3. Evan DriscollDec 4, 2010
  4. Nguyen Thai Ngoc DuyDec 4, 2010
  5. Evan DriscollDec 4, 2010
  6. Nguyen Thai Ngoc DuyDec 4, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.