{"thread":{"id":"26302","subject":"Manually turning a --bare local repository to a real mirror repository (--bare --mirror)","startedAt":"2011-01-18T21:59:58Z","lastAt":"2011-01-18T22:35:13Z","messageCount":2,"participants":["Ilyes Gouta","Andreas Schwab"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"159608","messageId":"AANLkTikE-sDhzw8=ybKhYhHtTH84V8EEOptMaq8xxRHc@mail.gmail.com","threadId":"26302","inReplyTo":null,"subject":"Manually turning a --bare local repository to a real mirror repository (--bare --mirror)","fromName":"Ilyes Gouta","fromEmail":"ilyes.gouta@gmail.com","sentAt":"2011-01-18T21:59:58Z","receivedAt":"2011-01-18T21:59:58Z","isPatch":false,"sender":{"key":"ilyes.gouta@gmail.com","avatar":null},"body":"Hi,\n\nI'm setting up a local git repo which should mirrors the branches of\nthe original repo and at the same time hosts the local private\ndevelopement branches of the team.\n\nAt first step I did create a local copy by issuing:\n\ngit clone --bare <original_git_repository>\n\nI found out later that fetching the various refs lead the local master\nref not automatically following the remote/master ref, after every git\nfetch --all. I found that I have to use:\n\ngit clone --bare --mirror <original_git_repository>\n\ninstead to get that effect. Now please keep in mind that I intend to\nalso create local private branches where developers will push their\ncustom code.\n\nMy question: given that I don't have enough bandwidth and constant\nInternet connectivity, I'd like to ask if it's possible to manually\nturn a pure --bare local repository into a --bare --mirror one? If\nyes, how to do that?\n\nPlease CC me when replying, because I'm not registered to the mailing list.\n\nThanks,\n\n-Ilyes\n"},{"id":"159609","messageId":"m2wrm13kny.fsf@igel.home","threadId":"26302","inReplyTo":"AANLkTikE-sDhzw8=ybKhYhHtTH84V8EEOptMaq8xxRHc@mail.gmail.com","subject":"Re: Manually turning a --bare local repository to a real mirror repository (--bare --mirror)","fromName":"Andreas Schwab","fromEmail":"schwab@linux-m68k.org","sentAt":"2011-01-18T22:35:13Z","receivedAt":"2011-01-18T22:35:13Z","isPatch":false,"sender":{"key":"schwab@linux-m68k.org","avatar":"https://avatars.githubusercontent.com/u/2175493?v=4"},"body":"> My question: given that I don't have enough bandwidth and constant\n> Internet connectivity, I'd like to ask if it's possible to manually\n> turn a pure --bare local repository into a --bare --mirror one? If\n> yes, how to do that?\n\nAn ordinary bare clone has no fetch configuration.  To turn the repo\ninto a mirror you just have to add one:\n\n$ git config remote.origin.fetch \"+refs/*:refs/*\"\n\nand set the mirror flag:\n\n$ git config remote.origin.mirror true\n\nThen do a git fetch to fetch any missing refs.\n\nAndreas.\n\n-- \nAndreas Schwab, schwab@linux-m68k.org\nGPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5\n\"And now for something completely different.\"\n"}]}