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

How to stop sharing objects between repositories

From
Jon Jensen <jon@endpoint.com>
Date
Aug 16, 2009, 00:04 UTC
Message-ID
<alpine.DEB.2.00.0908151756150.29215@nhtr.ovalna.fjrygre.arg>
Hello.
Situation: I used "git clone -s" to share objects between repositories. 
That creates .git/objects/info/alternates, which points to the other 
repository. Later I need to remove the dependency and make the dependent 
repository self-sufficient, i.e. it should have all the objects internal 
to itself.

I've looked around for a way to do that but haven't found either tools or instructions.

I came up with this manual way, copying over the unique remote objects and then removing the alternate repository pointer:

(cd /path/to/alternate/repo.git/objects && tar cp .) | (cd .git/objects && tar xvpk) # some objects will already exist and be skipped, leading to an error on exit, which is fine rm .git/objects/info/alternates # or if there's more than one and you're only removing one, edit the alternates file and remove only that pointer

(With GNU tar -C the copy is a little simpler.)
I posted this to the wiki:
http://git.or.cz/gitwiki/GitFaq#Howtostopsharingobjectsbetweenrepositories.3F

If there's a better or built-in way to do this with Git tools, I'd like to learn it, and I'd be happy to update the wiki accordingly.

Thanks, Jon

-- 
Jon Jensen
End Point Corporation
http://www.endpoint.com/
Next: Johannes Schindelin
Message 1 of 18 in “How to stop sharing objects between repositories”
  1. Jon JensenAug 16, 2009
  2. Johannes SchindelinAug 16, 2009
  3. Jeff KingAug 16, 2009
  4. Johannes SchindelinAug 16, 2009
  5. Daniel VilleneuveAug 16, 2009
  6. Johannes SchindelinAug 16, 2009
  7. Jeff KingAug 16, 2009
  8. Junio C HamanoAug 16, 2009
  9. Mike GalbraithAug 17, 2009
  10. Jeff KingAug 17, 2009
  11. Mike GalbraithAug 17, 2009
  12. Junio C HamanoAug 17, 2009
  13. Jeff KingAug 17, 2009
  14. Junio C HamanoAug 17, 2009
  15. Jeff KingAug 17, 2009
  16. Jeff KingAug 17, 2009
  17. Jeff KingAug 17, 2009
  18. Jeff KingAug 17, 2009

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.