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

Setting Up a GIT Repository Mirror

From
YRYaser Raja <yrraja@gmail.com>
Date
Nov 6, 2008, 15:08 UTC
Message-ID
<e97d51700811060708y5deb9e9ek4a36c012726b3a63@mail.gmail.com>
In-Reply-To
<e97d51700811060706t40433bb9k7a3704429f244164@mail.gmail.com>
Hi

I have a main repository placed at a remote location and i want to have a read-only mirror of this repository available locally. The users/automated processes will use this local mirror to get the latest code.

Can anyone guide me how to implement this? I did make a basic setup as follows but it has some issues:

1. Create a clone (MirrorRep) of the remote git repository (MainRep)
on a local machine using "git-clone" command
         git-clone ssh://<user>@<remote machine addr> MyMirror
2. Use "git-pull" to keep this repository (MirrorRep) in sync with the
main repository. I added entry in /etc/crontab to invoke "git-pull"
after every 10 minutes to update this repository.
3. Launch "git-daemon" so that local users can access and clone from
this  Mirror Repository.
         git-daemon --export-all --verbose --base-path=<base path to
MyMirror directory>

After this the users can easily clone from the local repository and work with it. The problem is that the branches that were present in MainRep are not visible in the clones made using MirrorRep. When MirrorRep was created all the branches of MainRep became remote branches for MirrorRep. And when users make a clone from MirrorRep none of the remote branches are transfered over.

I came to know about --mirror option of git-clone and used it to make a bare repository replica of the MainRep. Now i am not sure how to keep it in sync with the MainRep.

Thanks Yaser

Next: Santi Béjar
Message 1 of 3 in “Setting Up a GIT Repository Mirror”
  1. Yaser RajaNov 6, 2008
  2. Santi BéjarNov 6, 2008
  3. Yaser RajaNov 7, 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.