{"thread":{"id":"16199","subject":"Setting Up a GIT Repository Mirror","startedAt":"2008-11-06T15:08:24Z","lastAt":"2008-11-07T07:17:58Z","messageCount":3,"participants":["Yaser Raja","Santi Béjar"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"95053","messageId":"e97d51700811060708y5deb9e9ek4a36c012726b3a63@mail.gmail.com","threadId":"16199","inReplyTo":"e97d51700811060706t40433bb9k7a3704429f244164@mail.gmail.com","subject":"Setting Up a GIT Repository Mirror","fromName":"Yaser Raja","fromEmail":"yrraja@gmail.com","sentAt":"2008-11-06T15:08:24Z","receivedAt":"2008-11-06T15:08:24Z","isPatch":false,"sender":{"key":"yrraja@gmail.com","avatar":null},"body":"Hi\n\nI have a main repository placed at a remote location and i want to\nhave a read-only mirror of this repository available locally. The\nusers/automated processes will use this local mirror to get the latest\ncode.\n\nCan anyone guide me how to implement this? I did make a basic setup as\nfollows but it has some issues:\n\n1. Create a clone (MirrorRep) of the remote git repository (MainRep)\non a local machine using \"git-clone\" command\n         git-clone ssh://<user>@<remote machine addr> MyMirror\n\n2. Use \"git-pull\" to keep this repository (MirrorRep) in sync with the\nmain repository. I added entry in /etc/crontab to invoke \"git-pull\"\nafter every 10 minutes to update this repository.\n\n3. Launch \"git-daemon\" so that local users can access and clone from\nthis  Mirror Repository.\n         git-daemon --export-all --verbose --base-path=<base path to\nMyMirror directory>\n\nAfter this the users can easily clone from the local repository and\nwork with it. The problem is that the branches that were present in\nMainRep are not visible in the clones made using MirrorRep. When\nMirrorRep was created all the branches of MainRep became remote\nbranches for MirrorRep. And when users make a clone from MirrorRep\nnone of the remote branches are transfered over.\n\nI came to know about --mirror option of git-clone and used it to make\na bare repository replica of the MainRep. Now i am not sure how to\nkeep it in sync with the MainRep.\n\nThanks\nYaser\n"},{"id":"95055","messageId":"adf1fd3d0811060733t28008f0cld1a3b3c5bf4ff4d8@mail.gmail.com","threadId":"16199","inReplyTo":"e97d51700811060708y5deb9e9ek4a36c012726b3a63@mail.gmail.com","subject":"Re: Setting Up a GIT Repository Mirror","fromName":"Santi Béjar","fromEmail":"santi@agolina.net","sentAt":"2008-11-06T15:33:47Z","receivedAt":"2008-11-06T15:33:47Z","isPatch":false,"sender":{"key":"santi@agolina.net","avatar":null},"body":"On Thu, Nov 6, 2008 at 4:08 PM, Yaser Raja <yrraja@gmail.com> wrote:\n> Hi\n[...]\n\n> I came to know about --mirror option of git-clone and used it to make\n> a bare repository replica of the MainRep. Now i am not sure how to\n> keep it in sync with the MainRep.\n\n$ git fetch\n\nas it is bare you cannot merge, so you cannot pull.\n\nHTH,\nSanti\n"},{"id":"95104","messageId":"e97d51700811062317s351e165eh14d4343223a8e91f@mail.gmail.com","threadId":"16199","inReplyTo":"adf1fd3d0811060733t28008f0cld1a3b3c5bf4ff4d8@mail.gmail.com","subject":"Re: Setting Up a GIT Repository Mirror","fromName":"Yaser Raja","fromEmail":"yrraja@gmail.com","sentAt":"2008-11-07T07:17:58Z","receivedAt":"2008-11-07T07:17:58Z","isPatch":false,"sender":{"key":"yrraja@gmail.com","avatar":null},"body":"On Thu, Nov 6, 2008 at 8:33 PM, Santi Béjar <santi@agolina.net> wrote:\n> On Thu, Nov 6, 2008 at 4:08 PM, Yaser Raja <yrraja@gmail.com> wrote:\n>> Hi\n> [...]\n>\n>> I came to know about --mirror option of git-clone and used it to make\n>> a bare repository replica of the MainRep. Now i am not sure how to\n>> keep it in sync with the MainRep.\n>\n> $ git fetch\n>\n> as it is bare you cannot merge, so you cannot pull.\n>\n> HTH,\n> Santi\n>\n\nHere is what i get when i try to use git-fetch:\n\n# git fetch\nssh: : Name or service not known\nfatal: The remote end hung up unexpectedly\n\nFollowing is the current content of my config file:\n\n[core]\n        repositoryformatversion = 0\n        filemode = true\n        bare = true\n[remote \"origin\"]\n        url = ssh://gituser@<addr removed>\n        fetch = +refs/*:refs/*\n        mirror = yes\n\nI also tried git-fetch with the url as argument but that also gave the\nsame error. Do i need to do some additional configurations to make\nfetch work?\n\nThanks\nYaser\n"}]}