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

Re: tracking repository

From
KJkenneth johansson <ken@kenjo.org>
Date
Mar 16, 2008, 20:02 UTC
Message-ID
<1205697779.12760.20.camel@duo>
In-Reply-To
<7vabkzmltc.fsf@gitster.siamese.dyndns.org>
On Sat, 2008-03-15 at 19:42 -0700, Junio C Hamano wrote:
Show 9 quoted lines
> You do not want to have any of your own work in this repository, however,
> so there is no reason to separate the remote ones in remotes/origin/
> namespace.  You would want "mirroring".
> 
> You can have in your $GIT_DIR/config something like this:
> 
>         [remote "origin"]
> 		url = $elsewhere
>                 fetch = +refs/heads/*:refs/heads/*
> Modern git allows this setup via "git remote add --mirror"; it is merely a
> convenience wrapper and it is perfectly fine to edit the configuration
> file yourself without using it.

I tried using the option --mirror but then the config end up in a way that all remote repositories master branch maps to exactly the same name.

However changing the config file manually I did get one that works more or less as I intended.

So with the below config I can create an empty directory and in that do "git --bare init" copy in the config file and any objects I have laying around. then simply put a cron job that once a day do a "git remote update"

the resulting repository is then possible to clone. And as long as no repacking is done the object data will be shared. But to share data even after a repack I guess I need to use GIT_ALTERNATE_OBJECT_DIRECTORIES for my local clone. And then I need to be very careful when doing any pruning on the download repository since my local clone could need data that is no longer needed in the download repository.

What would a safe procedure be ?? copy all data in the object hierarchy from the download repository to my local clones then do a gc in them starting from the download repository.

------------
[core]
	repositoryformatversion = 0
	filemode = true
	bare = true
[remote "linus"]
	url =
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
	fetch = +refs/heads/*:refs/heads/*
[remote "stable_2.6.12"]
	url =
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-2.6.12.y.git
	fetch = +refs/heads/*:refs/heads/stable_2.6.12_*
[remote "stable_2.6.13"]
	url =
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-2.6.13.y.git
	fetch = +refs/heads/*:refs/heads/stable_2.6.13_*
[remote "stable_2.6.14"]
	url =
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-2.6.14.y.git
	fetch = +refs/heads/*:refs/heads/stable_2.6.14_*
[remote "stable_2.6.15"]
	url =
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-2.6.15.y.git
	fetch = +refs/heads/*:refs/heads/stable_2.6.15_*
[remote "stable_2.6.16"]
	url =
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-2.6.16.y.git
	fetch = +refs/heads/*:refs/heads/stable_2.6.16_*
[remote "stable_2.6.17"]
	url =
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-2.6.17.y.git
	fetch = +refs/heads/*:refs/heads/stable_2.6.17_*
[remote "stable_2.6.18"]
	url =
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-2.6.18.y.git
	fetch = +refs/heads/*:refs/heads/stable_2.6.18_*
[remote "stable_2.6.19"]
	url =
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-2.6.19.y.git
	fetch = +refs/heads/*:refs/heads/stable_2.6.19_*
[remote "stable_2.6.20"]
	url =
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-2.6.20.y.git
	fetch = +refs/heads/*:refs/heads/stable_2.6.20_*
[remote "stable_2.6.21"]
	url =
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-2.6.21.y.git
	fetch = +refs/heads/*:refs/heads/stable_2.6.21_*
[remote "stable_2.6.22"]
	url =
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-2.6.22.y.git
	fetch = +refs/heads/*:refs/heads/stable_2.6.22_*
[remote "stable_2.6.23"]
	url =
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-2.6.23.y.git
	fetch = +refs/heads/*:refs/heads/stable_2.6.23_*
[remote "stable_2.6.24"]
	url =
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-2.6.24.y.git
	fetch = +refs/heads/*:refs/heads/stable_2.6.24_*
------------
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 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.