{"thread":{"id":"20124","subject":"Make a non-bare repo bare.","startedAt":"2009-07-15T21:43:54Z","lastAt":"2009-07-17T03:59:25Z","messageCount":13,"participants":["Tim Visher","Paolo Bonzini","Jeff King","Junio C Hamano","Graeme Geldenhuys","Mike Ralphson","Sitaram Chamarty"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"118046","messageId":"c115fd3c0907151443h49aaac60r3462c69f55ed2d9f@mail.gmail.com","threadId":"20124","inReplyTo":null,"subject":"Make a non-bare repo bare.","fromName":"Tim Visher","fromEmail":"tim.visher@gmail.com","sentAt":"2009-07-15T21:43:54Z","receivedAt":"2009-07-15T21:43:54Z","isPatch":false,"sender":{"key":"tim.visher@gmail.com","avatar":"https://gravatar.com/avatar/98307ce54bcac1a46b5d845827d5386e2a27895ff08790cdd3877ad527760575?d=mp&s=160"},"body":"Hello Everyone,\n\nI recently had occasion to make a previously non-bare repo bare.  Is\nthere any way to do this?  It will not allow me to delete a branch\nthat I'm on so I wasn't sure how to proceed.\n\nThanks!\n\n-- \n\nIn Christ,\n\nTimmy V.\n\nhttp://burningones.com/\nhttp://five.sentenc.es/ - Spend less time on e-mail\n"},{"id":"118047","messageId":"4A5E4EBA.4050708@gnu.org","threadId":"20124","inReplyTo":"c115fd3c0907151443h49aaac60r3462c69f55ed2d9f@mail.gmail.com","subject":"Re: Make a non-bare repo bare.","fromName":"Paolo Bonzini","fromEmail":"bonzini@gnu.org","sentAt":"2009-07-15T21:48:42Z","receivedAt":"2009-07-15T21:48:42Z","isPatch":false,"sender":{"key":"bonzini@gnu.org","avatar":"https://avatars.githubusercontent.com/u/42082?v=4"},"body":"On 07/15/2009 11:43 PM, Tim Visher wrote:\n> Hello Everyone,\n>\n> I recently had occasion to make a previously non-bare repo bare.  Is\n> there any way to do this?  It will not allow me to delete a branch\n> that I'm on so I wasn't sure how to proceed.\n\nJust do \"mv repo/.git repo.git; rm -rf repo\" (with care!).\n\nPaolo\n"},{"id":"118060","messageId":"c115fd3c0907151754o55acec54ocdcdebe177b3c9c4@mail.gmail.com","threadId":"20124","inReplyTo":"4A5E4EBA.4050708@gnu.org","subject":"Re: Make a non-bare repo bare.","fromName":"Tim Visher","fromEmail":"tim.visher@gmail.com","sentAt":"2009-07-16T00:54:01Z","receivedAt":"2009-07-16T00:54:01Z","isPatch":false,"sender":{"key":"tim.visher@gmail.com","avatar":"https://gravatar.com/avatar/98307ce54bcac1a46b5d845827d5386e2a27895ff08790cdd3877ad527760575?d=mp&s=160"},"body":"On Wed, Jul 15, 2009 at 5:48 PM, Paolo Bonzini<bonzini@gnu.org> wrote:\n> On 07/15/2009 11:43 PM, Tim Visher wrote:\n>> I recently had occasion to make a previously non-bare repo bare.  Is\n>> there any way to do this?  It will not allow me to delete a branch\n>> that I'm on so I wasn't sure how to proceed.\n>\n> Just do \"mv repo/.git repo.git; rm -rf repo\" (with care!).\n\nThanks, Paolo.\n\n-- \n\nIn Christ,\n\nTimmy V.\n\nhttp://burningones.com/\nhttp://five.sentenc.es/ - Spend less time on e-mail\n"},{"id":"118065","messageId":"20090716021921.GA29139@coredump.intra.peff.net","threadId":"20124","inReplyTo":"4A5E4EBA.4050708@gnu.org","subject":"Re: Make a non-bare repo bare.","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-07-16T02:19:21Z","receivedAt":"2009-07-16T02:19:21Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Jul 15, 2009 at 11:48:42PM +0200, Paolo Bonzini wrote:\n\n> On 07/15/2009 11:43 PM, Tim Visher wrote:\n> >I recently had occasion to make a previously non-bare repo bare.  Is\n> >there any way to do this?  It will not allow me to delete a branch\n> >that I'm on so I wasn't sure how to proceed.\n> \n> Just do \"mv repo/.git repo.git; rm -rf repo\" (with care!).\n\nThat used to work, but these days there is a \"core.bare\" config variable\nso that git doesn't have to guess whether you are in a bare repo. So you\nshould also do:\n\n  $ git config core.bare true\n\nin the resulting repo (or just before, since your \"mv\" is obviously not\na git command that would care).\n\n-Peff\n"},{"id":"118067","messageId":"7vbpnlbbln.fsf@alter.siamese.dyndns.org","threadId":"20124","inReplyTo":"c115fd3c0907151443h49aaac60r3462c69f55ed2d9f@mail.gmail.com","subject":"Re: Make a non-bare repo bare.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-07-16T02:33:40Z","receivedAt":"2009-07-16T02:33:40Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Tim Visher <tim.visher@gmail.com> writes:\n\n> Hello Everyone,\n>\n> I recently had occasion to make a previously non-bare repo bare.  Is\n> there any way to do this?  It will not allow me to delete a branch\n> that I'm on so I wasn't sure how to proceed.\n\nFunny.\n\n    http://article.gmane.org/gmane.comp.version-control.git/123303\n\nIt is posed as a question but describes the correct (and officially\nsupported) procedure.\n"},{"id":"118101","messageId":"h3mpls$9dt$1@ger.gmane.org","threadId":"20124","inReplyTo":"7vbpnlbbln.fsf@alter.siamese.dyndns.org","subject":"Re: Make a non-bare repo bare.","fromName":"Graeme Geldenhuys","fromEmail":"graemeg@gmail.com","sentAt":"2009-07-16T08:51:00Z","receivedAt":"2009-07-16T08:51:00Z","isPatch":false,"sender":{"key":"graemeg@gmail.com","avatar":"https://gravatar.com/avatar/fdaae0cf0a07bd33782720fb37ae0450f504d4e04c57c6e8f3517d11d503fdc6?d=mp&s=160"},"body":"Junio C Hamano wrote:\n> \n> Funny.\n> \n>     http://article.gmane.org/gmane.comp.version-control.git/123303\n> \n> It is posed as a question but describes the correct (and officially\n> supported) procedure.\n\n\nNow it deserves to be in some Git FAQ. It seems the issue is more common \nthan I thought. :-)\n\n\nRegards,\n   - Graeme -\n\n-- \nfpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal\nhttp://opensoft.homeip.net/fpgui/\n"},{"id":"118102","messageId":"e2b179460907160155g7c84b083u8a1dd6ba193f4531@mail.gmail.com","threadId":"20124","inReplyTo":"h3mpls$9dt$1@ger.gmane.org","subject":"Re: Make a non-bare repo bare.","fromName":"Mike Ralphson","fromEmail":"mike.ralphson@gmail.com","sentAt":"2009-07-16T08:55:27Z","receivedAt":"2009-07-16T08:55:27Z","isPatch":false,"sender":{"key":"mike.ralphson@gmail.com","avatar":"https://avatars.githubusercontent.com/u/21603?v=4"},"body":"2009/7/16 Graeme Geldenhuys <graemeg@gmail.com>:\n> Junio C Hamano wrote:\n>>\n>> Funny.\n>>\n>>    http://article.gmane.org/gmane.comp.version-control.git/123303\n>>\n>> It is posed as a question but describes the correct (and officially\n>> supported) procedure.\n>\n>\n> Now it deserves to be in some Git FAQ. It seems the issue is more common\n> than I thought. :-)\n\nIt already is\n\nhttp://git.or.cz/gitwiki/GitFaq#HowdoImakeexistingnon-barerepositorybare.3F\n\nunless that's new?\n"},{"id":"118109","messageId":"2e24e5b90907160439i29171e9fka3baf6bf871a6011@mail.gmail.com","threadId":"20124","inReplyTo":"7vbpnlbbln.fsf@alter.siamese.dyndns.org","subject":"Re: Make a non-bare repo bare.","fromName":"Sitaram Chamarty","fromEmail":"sitaramc@gmail.com","sentAt":"2009-07-16T11:39:37Z","receivedAt":"2009-07-16T11:39:37Z","isPatch":false,"sender":{"key":"sitaramc@gmail.com","avatar":"https://avatars.githubusercontent.com/u/43316?v=4"},"body":"On Thu, Jul 16, 2009 at 8:03 AM, Junio C Hamano<gitster@pobox.com> wrote:\n> Tim Visher <tim.visher@gmail.com> writes:\n>\n>> Hello Everyone,\n>>\n>> I recently had occasion to make a previously non-bare repo bare.  Is\n>> there any way to do this?  It will not allow me to delete a branch\n>> that I'm on so I wasn't sure how to proceed.\n>\n> Funny.\n>\n>    http://article.gmane.org/gmane.comp.version-control.git/123303\n>\n> It is posed as a question but describes the correct (and officially\n> supported) procedure.\n\nThe linked procedure uses git clone --bare.  It is my belief (and\nplease correct me if I'm wrong) that only a git clone --mirror\nactually does what you want here -- a mere \"bare\" clone would lose\nyour remotes and their tracking branches would it not?\n\nIf I'm wrong please correct me...\n"},{"id":"118110","messageId":"c115fd3c0907160447m3be44bcci46aa9d812884a8f6@mail.gmail.com","threadId":"20124","inReplyTo":"2e24e5b90907160439i29171e9fka3baf6bf871a6011@mail.gmail.com","subject":"Re: Make a non-bare repo bare.","fromName":"Tim Visher","fromEmail":"tim.visher@gmail.com","sentAt":"2009-07-16T11:47:20Z","receivedAt":"2009-07-16T11:47:20Z","isPatch":false,"sender":{"key":"tim.visher@gmail.com","avatar":"https://gravatar.com/avatar/98307ce54bcac1a46b5d845827d5386e2a27895ff08790cdd3877ad527760575?d=mp&s=160"},"body":"On Thu, Jul 16, 2009 at 8:03 AM, Junio C Hamano<gitster@pobox.com> wrote:\n> Tim Visher <tim.visher@gmail.com> writes:\n>\n>> Hello Everyone,\n>>\n>> I recently had occasion to make a previously non-bare repo bare.  Is\n>> there any way to do this?  It will not allow me to delete a branch\n>> that I'm on so I wasn't sure how to proceed.\n>\n> Funny.\n>\n>    http://article.gmane.org/gmane.comp.version-control.git/123303\n>\n> It is posed as a question but describes the correct (and officially\n> supported) procedure.\n\nThanks.  That's what I was looking for.  I wish I didn't have to\nactually clone the repo anew but if that's how it is, oh well. :)\n\nThat wiki response seems to contradict what Junio said\n\nOn Thu, Jul 16, 2009 at 7:39 AM, Sitaram Chamarty<sitaramc@gmail.com> wrote:\n> The linked procedure uses git clone --bare.  It is my belief (and\n> please correct me if I'm wrong) that only a git clone --mirror\n> actually does what you want here -- a mere \"bare\" clone would lose\n> your remotes and their tracking branches would it not?\n>\n> If I'm wrong please correct me...\n\nThe linked wiki article seems to contradict what Junio said.  I guess\nI'd go with Junio being somewhat authoritative on normative\nprodecudures in the git world. /me shrugs.\n\n-- \n\nIn Christ,\n\nTimmy V.\n\nhttp://burningones.com/\nhttp://five.sentenc.es/ - Spend less time on e-mail\n"},{"id":"118132","messageId":"7vd4808iey.fsf@alter.siamese.dyndns.org","threadId":"20124","inReplyTo":"e2b179460907160155g7c84b083u8a1dd6ba193f4531@mail.gmail.com","subject":"Re: Make a non-bare repo bare.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-07-16T20:47:01Z","receivedAt":"2009-07-16T20:47:01Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Mike Ralphson <mike.ralphson@gmail.com> writes:\n\n> 2009/7/16 Graeme Geldenhuys <graemeg@gmail.com>:\n>> Junio C Hamano wrote:\n>>>\n>>> Funny.\n>>>\n>>>    http://article.gmane.org/gmane.comp.version-control.git/123303\n>>>\n>>> It is posed as a question but describes the correct (and officially\n>>> supported) procedure.\n>>\n>>\n>> Now it deserves to be in some Git FAQ. It seems the issue is more common\n>> than I thought. :-)\n>\n> It already is\n>\n> http://git.or.cz/gitwiki/GitFaq#HowdoImakeexistingnon-barerepositorybare.3F\n>\n> unless that's new?\n\nSomebody needs to promise to keep that entry up-to-date, or we should\nrewrite it so that we do not expose such an implementation detail.\n\nEven today core.bare is not the only difference between a repository with\na work tree and a bare one.  We also set core.logallrefupdates these days\nfor a repository with a work tree, so the procedure described there is\nalready stale.  And this kind of implementation details are bound to\nchange.\n\nAsking git what to do is the only reliable \"cut-and-paste-ready\" recipe.\n"},{"id":"118133","messageId":"7v8wio8i73.fsf@alter.siamese.dyndns.org","threadId":"20124","inReplyTo":"2e24e5b90907160439i29171e9fka3baf6bf871a6011@mail.gmail.com","subject":"Re: Make a non-bare repo bare.","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-07-16T20:51:44Z","receivedAt":"2009-07-16T20:51:44Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Sitaram Chamarty <sitaramc@gmail.com> writes:\n\n> On Thu, Jul 16, 2009 at 8:03 AM, Junio C Hamano<gitster@pobox.com> wrote:\n>> Tim Visher <tim.visher@gmail.com> writes:\n>>\n>>> Hello Everyone,\n>>>\n>>> I recently had occasion to make a previously non-bare repo bare.  Is\n>>> there any way to do this?  It will not allow me to delete a branch\n>>> that I'm on so I wasn't sure how to proceed.\n>>\n>> Funny.\n>>\n>>    http://article.gmane.org/gmane.comp.version-control.git/123303\n>>\n>> It is posed as a question but describes the correct (and officially\n>> supported) procedure.\n>\n> The linked procedure uses git clone --bare.  It is my belief (and\n> please correct me if I'm wrong) that only a git clone --mirror\n> actually does what you want here -- a mere \"bare\" clone would lose\n> your remotes and their tracking branches would it not?\n\nDepends on \"what you want here\".\n\nI assumed that the request was to set up the most typical use of a bare\nrepository, that is to prepare a distribution point, separate from your\nprimary working repository with a work tree, from which you push your\nupdates into this new bare repository.\n\nAnd in such a distribution point, you do not need nor want remotes.  The\npoint of remote tracking branches is to let you peek what others are doing\nand merge with them, and that is done while you advance your history in\nyour primary working area with the work tree.  It does not happen in your\ndistribution point.\n"},{"id":"118149","messageId":"2e24e5b90907161820o5ee24491j8744a8652e7dec26@mail.gmail.com","threadId":"20124","inReplyTo":"7v8wio8i73.fsf@alter.siamese.dyndns.org","subject":"Re: Make a non-bare repo bare.","fromName":"Sitaram Chamarty","fromEmail":"sitaramc@gmail.com","sentAt":"2009-07-17T01:20:34Z","receivedAt":"2009-07-17T01:20:34Z","isPatch":false,"sender":{"key":"sitaramc@gmail.com","avatar":"https://avatars.githubusercontent.com/u/43316?v=4"},"body":"On Fri, Jul 17, 2009 at 2:21 AM, Junio C Hamano<gitster@pobox.com> wrote:\n> Sitaram Chamarty <sitaramc@gmail.com> writes:\n\n>> The linked procedure uses git clone --bare.  It is my belief (and\n>> please correct me if I'm wrong) that only a git clone --mirror\n>> actually does what you want here -- a mere \"bare\" clone would lose\n>> your remotes and their tracking branches would it not?\n>\n> Depends on \"what you want here\".\n>\n> I assumed that the request was to set up the most typical use of a bare\n> repository, that is to prepare a distribution point, separate from your\n> primary working repository with a work tree, from which you push your\n> updates into this new bare repository.\n>\n> And in such a distribution point, you do not need nor want remotes.  The\n> point of remote tracking branches is to let you peek what others are doing\n> and merge with them, and that is done while you advance your history in\n> your primary working area with the work tree.  It does not happen in your\n> distribution point.\n\nI agree, bares dont have remotes, normally.\n\nI was speaking purely from a technical point of view.  Contrast, if\nyou will, with the other method seen in the thread and elsewhere (the\nmv repo/.git repo.git, rm -rf repo, git config core.bare in repo.git\nstuff), which does preserve all this.\n\nAnyway, you confirmed my _understanding_ of clone bare versus clone\nmirror, which is what I was looking for.  Thanks!\n\nSitaram\n"},{"id":"118153","messageId":"2e24e5b90907162059u5e3dfca1x16cd57b0a10a7204@mail.gmail.com","threadId":"20124","inReplyTo":"7vd4808iey.fsf@alter.siamese.dyndns.org","subject":"Re: Make a non-bare repo bare.","fromName":"Sitaram Chamarty","fromEmail":"sitaramc@gmail.com","sentAt":"2009-07-17T03:59:25Z","receivedAt":"2009-07-17T03:59:25Z","isPatch":false,"sender":{"key":"sitaramc@gmail.com","avatar":"https://avatars.githubusercontent.com/u/43316?v=4"},"body":"On Fri, Jul 17, 2009 at 2:17 AM, Junio C Hamano<gitster@pobox.com> wrote:\n> Mike Ralphson <mike.ralphson@gmail.com> writes:\n\n>> http://git.or.cz/gitwiki/GitFaq#HowdoImakeexistingnon-barerepositorybare.3F\n\n> Somebody needs to promise to keep that entry up-to-date, or we should\n> rewrite it so that we do not expose such an implementation detail.\n>\n> Even today core.bare is not the only difference between a repository with\n> a work tree and a bare one.  We also set core.logallrefupdates these days\n> for a repository with a work tree, so the procedure described there is\n> already stale.  And this kind of implementation details are bound to\n> change.\n\nI wonder why core.logAllRefUpdates is not the default for bare repos.\nI have taken to making that the _global_ default on any git/gitosis\nserver I install, so all my bare repos have it turned on.\n\nMy reason is that I do want to allow \"push -f\" (it _is_ sometimes\nneeded), but I also want to protect against such push happening in\nerror, and the reflog has always seemed like a good safety net to run\nto when that happens.\n\nOther than space (due to garbage collection delay until reflog expire)\nwhat are the downsides?  Could someone enlighten me if I'm doing\nsomething stupid here?\n\nThanks,\n\nSitaram\n"}]}