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

tracking repository

From
KJkenneth johansson <ken@kenjo.org>
Date
Mar 15, 2008, 19:35 UTC
Message-ID
<frh8dg$t9j$1@ger.gmane.org>

I was trying to create a repository used only to track different linux git repositories. The goal with this was to maximize object sharing and having one local copy of the data.

But I think I managed to paint myself into a corner. Here was my initial setup.

create a directory "mkdir linux"

create a git data base "cd linux; git --bare init"

Add a few linux repositories with "git --bare remote add [name] [url]"

then download the objects/branches with "git remote update"

This works great and it will track all changes in the remote repositories without me having to worry about it aborting due to merge issues with my local branch or remote doing rebase on some branch.

The problem is that it is useless :( I can't find any way to use a repository with only remotes in it. Is there a way to make a clone of a remote branch in a repository ??

Now it is not entirely useless since I can reuse the objects downloaded by setting GIT_OBJECT_DIRECTORY. This works quite well until "git gc --prune" is used. I leave it up to the reader to figure out what happens then :(

So I guess there should be some warning about using GIT_OBJECT_DIRECTORY that points to the same object store for different repositories. It's obvious but still a warning in the man page could be helpful.

GIT_ALTERNATE_OBJECT_DIRECTORIES works much better. The only potential problem I see is if I set this is set in my environment when I login and then do operation on my tracking repository's it will now point into it's own object directory. I have not tried that yet.

The downside of only using the objects is that I need to setup the remotes again in my clone.

Now has anybody tried to do something similar? is there a better way?
Next: Junio C Hamano
Message 1 of 16 in “tracking repository”
  1. kenneth johanssonMar 15, 2008
  2. Junio C HamanoMar 16, 2008
  3. kenneth johanssonMar 16, 2008
  4. Junio C HamanoMar 16, 2008
  5. Daniel BarkalowMar 16, 2008
  6. Junio C HamanoMar 16, 2008
  7. Daniel BarkalowMar 16, 2008
  8. Junio C HamanoMar 16, 2008
  9. Junio C HamanoMar 16, 2008
  10. Daniel BarkalowMar 16, 2008
  11. Junio C HamanoMar 17, 2008
  12. Junio C HamanoMar 17, 2008
  13. Daniel BarkalowMar 17, 2008
  14. Daniel BarkalowMar 17, 2008
  15. Junio C HamanoMar 17, 2008
  16. Daniel BarkalowMar 17, 2008

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.