{"thread":{"id":"23260","subject":"mirror git repos: rsync vs. --mirror","startedAt":"2010-03-30T20:54:09Z","lastAt":"2010-03-31T03:05:53Z","messageCount":4,"participants":["Robin H. Johnson","Julian Phillips","Sitaram Chamarty"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"138215","messageId":"robbat2-20100330T205331-531407911Z@orbis-terrarum.net","threadId":"23260","inReplyTo":null,"subject":"mirror git repos: rsync vs. --mirror","fromName":"Robin H. Johnson","fromEmail":"robbat2@gentoo.org","sentAt":"2010-03-30T20:54:09Z","receivedAt":"2010-03-30T20:54:09Z","isPatch":false,"sender":{"key":"robbat2@gentoo.org","avatar":"https://avatars.githubusercontent.com/u/373898?v=4"},"body":"I'm trying to see about the state of automated mirroring git\nrepositories between different systems, eg. a private backend and a\npublic frontend, and ran into a catch between two possible options, each\nwith a downside. If there are other means besides these, I'm all ears\nfor them.\n\nrsync:\n------\nHow:\n- Simply rsync the git repository, atomically, and use --delete-after.\nBenefits:\n- Guaranteed to match between master/slaves.\nCaveats:\n- Need to know that the master repo is in a good state.\n- If a repo is repacked, there is a lot more traffic in the next sync.\n\ngit clone --mirror && git fetch:\n--------------------------------\nHow:\n- Setup with: \"git clone --mirror URL\"\n- Cronjob with: \"git fetch\"\nBenefits:\n- Extremely fast\n- Light on traffic\nCaveats:\n- Branches and tags deleted in master persist in slaves :-(\n- Seperate gc/repack needed on slaves.\n\nThe traffic vs. deleted branches/tags is the main tradeoff here, esp. as\nrepos get larger.\n\nCan git-fetch perhaps be made to delete the branches/tags?\n\n-- \nRobin Hugh Johnson\nGentoo Linux: Developer, Trustee & Infrastructure Lead\nE-Mail     : robbat2@gentoo.org\nGnuPG FP   : 11AC BA4F 4778 E3F6 E4ED  F38E B27B 944E 3488 4E85\n"},{"id":"138221","messageId":"3a75d1efc7cf125d84b8e02b7dabf7aa@212.159.54.234","threadId":"23260","inReplyTo":"robbat2-20100330T205331-531407911Z@orbis-terrarum.net","subject":"Re: mirror git repos: rsync vs. --mirror","fromName":"Julian Phillips","fromEmail":"julian@quantumfyre.co.uk","sentAt":"2010-03-30T22:00:44Z","receivedAt":"2010-03-30T22:00:44Z","isPatch":false,"sender":{"key":"julian@quantumfyre.co.uk","avatar":"https://avatars.githubusercontent.com/u/948888?v=4"},"body":"On Tue, 30 Mar 2010 20:54:09 +0000, \"Robin H. Johnson\"\n<robbat2@gentoo.org>\nwrote:\n> I'm trying to see about the state of automated mirroring git\n> repositories between different systems, eg. a private backend and a\n> public frontend, and ran into a catch between two possible options, each\n> with a downside. If there are other means besides these, I'm all ears\n> for them.\n\nYou can mitigate the git caveats somewhat ...\n\n> git clone --mirror && git fetch:\n> --------------------------------\n> How:\n> - Setup with: \"git clone --mirror URL\"\n> - Cronjob with: \"git fetch\"\n> Benefits:\n> - Extremely fast\n> - Light on traffic\n> Caveats:\n> - Branches and tags deleted in master persist in slaves :-(\n> - Seperate gc/repack needed on slaves.\n> \n> The traffic vs. deleted branches/tags is the main tradeoff here, esp. as\n> repos get larger.\n> \n> Can git-fetch perhaps be made to delete the branches/tags?\n\nI don't think that fetch can do it, but \"git remote prune origin\" will.\nYou could also add \"git gc --auto\" to your cron script to deal with the\nrepacking - I don't think fetch already does that ...\n\n-- \nJulian\n"},{"id":"138246","messageId":"t2r2e24e5b91003301844i6ea98c92j6dba55d916c841f5@mail.gmail.com","threadId":"23260","inReplyTo":"3a75d1efc7cf125d84b8e02b7dabf7aa@212.159.54.234","subject":"Re: mirror git repos: rsync vs. --mirror","fromName":"Sitaram Chamarty","fromEmail":"sitaramc@gmail.com","sentAt":"2010-03-31T01:44:46Z","receivedAt":"2010-03-31T01:44:46Z","isPatch":false,"sender":{"key":"sitaramc@gmail.com","avatar":"https://avatars.githubusercontent.com/u/43316?v=4"},"body":"On Wed, Mar 31, 2010 at 3:30 AM, Julian Phillips\n<julian@quantumfyre.co.uk> wrote:\n> On Tue, 30 Mar 2010 20:54:09 +0000, \"Robin H. Johnson\"\n> <robbat2@gentoo.org>\n\n>> git clone --mirror && git fetch:\n\n>> Caveats:\n>> - Branches and tags deleted in master persist in slaves :-(\n\n> I don't think that fetch can do it, but \"git remote prune origin\" will.\n\nas of 1.7 at least, fetch has --prune, and I tested it yesterday when\nsomeone (same person?) asked this on #git\n"},{"id":"138253","messageId":"robbat2-20100331T030517-069108593Z@orbis-terrarum.net","threadId":"23260","inReplyTo":"t2r2e24e5b91003301844i6ea98c92j6dba55d916c841f5@mail.gmail.com","subject":"Re: mirror git repos: rsync vs. --mirror","fromName":"Robin H. Johnson","fromEmail":"robbat2@gentoo.org","sentAt":"2010-03-31T03:05:53Z","receivedAt":"2010-03-31T03:05:53Z","isPatch":false,"sender":{"key":"robbat2@gentoo.org","avatar":"https://avatars.githubusercontent.com/u/373898?v=4"},"body":"On Wed, Mar 31, 2010 at 07:14:46AM +0530, Sitaram Chamarty wrote:\n> On Wed, Mar 31, 2010 at 3:30 AM, Julian Phillips\n> <julian@quantumfyre.co.uk> wrote:\n> > On Tue, 30 Mar 2010 20:54:09 +0000, \"Robin H. Johnson\"\n> > <robbat2@gentoo.org>\n> \n> >> git clone --mirror && git fetch:\n> \n> >> Caveats:\n> >> - Branches and tags deleted in master persist in slaves :-(\n> \n> > I don't think that fetch can do it, but \"git remote prune origin\" will.\n> as of 1.7 at least, fetch has --prune, and I tested it yesterday when\n> someone (same person?) asked this on #git\nWasn't me asking, but thanks, that helps lots!\n\nLooks like it was added for v1.6.6.\n\n-- \nRobin Hugh Johnson\nGentoo Linux: Developer, Trustee & Infrastructure Lead\nE-Mail     : robbat2@gentoo.org\nGnuPG FP   : 11AC BA4F 4778 E3F6 E4ED  F38E B27B 944E 3488 4E85\n"}]}