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

Question about .git/objects/info/alternates

From
Chris Packham <judge.packham@gmail.com>
Date
Mar 22, 2010, 17:26 UTC
Message-ID
<a038bef51003221026i379ee16ej6e0e6defcf0048dd@mail.gmail.com>
Hi All,

I've been using git clone --reference and git submodule update --reference to reduce the amount of data transferred when I cloned a repository that I already had an older copy of (that for one reason or another I didn't want to touch or clone directly).

Now I'm finding that what I really want to do is change around what is referencing what. I currently have the following.

  projecta.git
  base.git       # references project a
  projectb.git  # referenced base (which, now that I think about it,
was probably the wrong thing to do)
Ideally I'd want to end up with
  base.git      # has all objects
  projecta.git # uses base as a reference
  projectb.git # uses base as a reference also

I would like to have base somehow find the objects it doesn't have in its object store and either download them or just copy them from the object store of projecta. Then I can manually point projecta at base and repack (as discussed in this thread [1]) to free up some space. projectb should be fine as is because it already references base. Is there any way to actually do this? A little googling found hints on adding alternates after the fact but I'm actually interested in going the other direction. From reading [2] I think 'rm .git/objects/info/alternates && git repack -a' might do the trick but I'm not sure.

[1] http://thread.gmane.org/gmane.comp.version-control.git/141161/focus=141199 [2] http://stackoverflow.com/questions/2248228/how-to-detach-alternates-after-git-clone-reference

Next: Jonathan Nieder
Message 1 of 17 in “Question about .git/objects/info/alternates”
  1. Chris PackhamMar 22, 2010
  2. Jonathan NiederMar 23, 2010
  3. Chris PackhamMar 24, 2010
  4. Jonathan NiederMar 24, 2010
  5. Junio C HamanoMar 24, 2010
  6. Chris PackhamMar 24, 2010
  7. Chris PackhamMar 25, 2010
  8. 1/2 Add git alternate commandChris Packham, Mar 25, 2010
  9. Junio C HamanoMar 29, 2010
  10. Chris PackhamMar 31, 2010
  11. 2/2 tests for git alternate commandChris Packham, Mar 25, 2010
  12. Johannes SixtMar 25, 2010
  13. Chris PackhamMar 25, 2010
  14. Miklos VajnaMar 26, 2010
  15. Johannes SixtMar 26, 2010
  16. Stephen BoydMar 24, 2010
  17. Chris PackhamMar 24, 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.