{"thread":{"id":"20119","subject":"Correct way of making existing remote repository \"bare\"","startedAt":"2009-07-15T12:20:38Z","lastAt":"2009-07-16T07:59:01Z","messageCount":7,"participants":["Graeme Geldenhuys","Johannes Schindelin","Dirk Süsserott","Junio C Hamano","Eric Raible"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"118016","messageId":"h3khis$3tq$1@ger.gmane.org","threadId":"20119","inReplyTo":null,"subject":"Correct way of making existing remote repository \"bare\"","fromName":"Graeme Geldenhuys","fromEmail":"graemeg@gmail.com","sentAt":"2009-07-15T12:20:38Z","receivedAt":"2009-07-15T12:20:38Z","isPatch":false,"sender":{"key":"graemeg@gmail.com","avatar":"https://gravatar.com/avatar/fdaae0cf0a07bd33782720fb37ae0450f504d4e04c57c6e8f3517d11d503fdc6?d=mp&s=160"},"body":"Hi,\n\nYesterday I initialized a new repository on our server. I did some \ncoding locally, added the remote server (git remote add ....) and then \npushed my changes to the remote server.\n\nBut I noticed that my remote server is not a \"bare\" repository and git \ncomplains when I push to it again. What is the correct way to make an \nexisting remote repository bare?\n\nThis is what I did and it worked, but not sure if this is the correct \nway of doing it.\n\nSteps I done:\n\n* ssh to remote server\n* git clone --bare -l <path_to_repos> <new_dir>\n* renamed old repository directory\n* renamed new repository dir to what old repository used to be.\n\nLike I said, this did the tick, but is this the correct way of doing it?\n\n\nRegards,\n   - Graeme -\n\n-- \nfpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal\nhttp://opensoft.homeip.net/fpgui/\n"},{"id":"118023","messageId":"alpine.DEB.1.00.0907151607050.4410@intel-tinevez-2-302","threadId":"20119","inReplyTo":"h3khis$3tq$1@ger.gmane.org","subject":"Re: Correct way of making existing remote repository \"bare\"","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-07-15T14:08:53Z","receivedAt":"2009-07-15T14:08:53Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Wed, 15 Jul 2009, Graeme Geldenhuys wrote:\n\n> Steps I done:\n> \n> * ssh to remote server\n> * git clone --bare -l <path_to_repos> <new_dir>\n> * renamed old repository directory\n> * renamed new repository dir to what old repository used to be.\n> \n> Like I said, this did the tick, but is this the correct way of doing it?\n\nThat's the easiest.  However, I regularly avoid those steps by doing\n\n\tmv bla/.git bla.git\n\tgit --git-dir=bla.git config core.bare true\n\trm -rf bla\n\nThis requires a bit more familiarity with the Git internals than your \nsolution, though (although it makes sure that the config is unchanged, as \nwell as possibly installed hooks).\n\nCiao,\nDscho\n"},{"id":"118024","messageId":"4A5DE3DA.1010004@dirk.my1.cc","threadId":"20119","inReplyTo":"h3khis$3tq$1@ger.gmane.org","subject":"Re: Correct way of making existing remote repository \"bare\"","fromName":"Dirk Süsserott","fromEmail":"newsletter@dirk.my1.cc","sentAt":"2009-07-15T14:12:42Z","receivedAt":"2009-07-15T14:12:42Z","isPatch":false,"sender":{"key":"newsletter@dirk.my1.cc","avatar":null},"body":"Am 15.07.2009 14:20 schrieb Graeme Geldenhuys:\n> Hi,\n> \n> Yesterday I initialized a new repository on our server. I did some \n> coding locally, added the remote server (git remote add ....) and then \n> pushed my changes to the remote server.\n> \n> But I noticed that my remote server is not a \"bare\" repository and git \n> complains when I push to it again. What is the correct way to make an \n> existing remote repository bare?\n> \n> This is what I did and it worked, but not sure if this is the correct \n> way of doing it.\n> \n> Steps I done:\n> \n> * ssh to remote server\n> * git clone --bare -l <path_to_repos> <new_dir>\n> * renamed old repository directory\n> * renamed new repository dir to what old repository used to be.\n> \n> Like I said, this did the tick, but is this the correct way of doing it?\n> \n> \n> Regards,\n>   - Graeme -\n> \n\nSounds like that's the correct way. I sometimes faced the same problem \nand was lazy:\n\n$ ssh to the remote && cd repo\n$ rm everything except for the .git directory (make sure everything is \ncommitted before doing this)\n$ mv .git/* . && rmdir .git # i.e.move the .git contents one level up\n$ edit config\nchange 'core.bare=false' to 'core.bare=true' (or add a similar line)\n\ndone.\n\nI think what you did is 'porcellain' while my solution is 'plumbing'.\nAny complaints?\n\n     Dirk\n"},{"id":"118025","messageId":"4A5DE5FD.80304@dirk.my1.cc","threadId":"20119","inReplyTo":"alpine.DEB.1.00.0907151607050.4410@intel-tinevez-2-302","subject":"Re: Correct way of making existing remote repository \"bare\"","fromName":"Dirk Süsserott","fromEmail":"newsletter@dirk.my1.cc","sentAt":"2009-07-15T14:21:49Z","receivedAt":"2009-07-15T14:21:49Z","isPatch":false,"sender":{"key":"newsletter@dirk.my1.cc","avatar":null},"body":"Am 15.07.2009 16:08 schrieb Johannes Schindelin:\n> Hi,\n> \n> On Wed, 15 Jul 2009, Graeme Geldenhuys wrote:\n> \n>> Steps I done:\n>>\n>> * ssh to remote server\n>> * git clone --bare -l <path_to_repos> <new_dir>\n>> * renamed old repository directory\n>> * renamed new repository dir to what old repository used to be.\n>>\n>> Like I said, this did the tick, but is this the correct way of doing it?\n> \n> That's the easiest.  However, I regularly avoid those steps by doing\n> \n> \tmv bla/.git bla.git\n> \tgit --git-dir=bla.git config core.bare true\n> \trm -rf bla\n> \n> This requires a bit more familiarity with the Git internals than your \n> solution, though (although it makes sure that the config is unchanged, as \n> well as possibly installed hooks).\n> \n\nDscho, you boiled down my solution to real git commands. Great. -- Dirk\n"},{"id":"118026","messageId":"h3kq06$vml$1@ger.gmane.org","threadId":"20119","inReplyTo":"alpine.DEB.1.00.0907151607050.4410@intel-tinevez-2-302","subject":"Re: Correct way of making existing remote repository \"bare\"","fromName":"Graeme Geldenhuys","fromEmail":"graemeg@gmail.com","sentAt":"2009-07-15T14:44:17Z","receivedAt":"2009-07-15T14:44:17Z","isPatch":false,"sender":{"key":"graemeg@gmail.com","avatar":"https://gravatar.com/avatar/fdaae0cf0a07bd33782720fb37ae0450f504d4e04c57c6e8f3517d11d503fdc6?d=mp&s=160"},"body":"Johannes Schindelin wrote:\n> \n> That's the easiest.  However, I regularly avoid those steps by doing\n\nThanks Johannes and Dirk. I'll make a not of this.\n\nMaybe somebody could add this to some Git FAQ?  I did some Google'ing \nand didn't find any documentation on this (well nothing blatantly visible).\n\n\nRegards,\n   - Graeme -\n\n-- \nfpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal\nhttp://opensoft.homeip.net/fpgui/\n"},{"id":"118043","messageId":"7vws69enws.fsf@alter.siamese.dyndns.org","threadId":"20119","inReplyTo":"4A5DE3DA.1010004@dirk.my1.cc","subject":"Re: Correct way of making existing remote repository \"bare\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-07-15T19:39:31Z","receivedAt":"2009-07-15T19:39:31Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Dirk Süsserott <newsletter@dirk.my1.cc> writes:\n\n> I think what you did is 'porcellain' while my solution is 'plumbing'.\n> Any complaints?\n\nNo.\n\nWe need to be careful and either (1) to have anybody who adds 'plumbing'\nprocedure to any FAQ responsible for keeping it up to date, as the\nimplementation detail is subject to change, or (2) only to have\n'Porcelain' description in the documentation.\n"},{"id":"118091","messageId":"loom.20090716T074910-226@post.gmane.org","threadId":"20119","inReplyTo":"alpine.DEB.1.00.0907151607050.4410@intel-tinevez-2-302","subject":"Re: Correct way of making existing remote repository \"bare\"","fromName":"Eric Raible","fromEmail":"raible@gmail.com","sentAt":"2009-07-16T07:59:01Z","receivedAt":"2009-07-16T07:59:01Z","isPatch":false,"sender":{"key":"raible@gmail.com","avatar":null},"body":"Johannes Schindelin <Johannes.Schindelin <at> gmx.de> writes:\n\n> That's the easiest.  However, I regularly avoid those steps by doing\n> \n> \tmv bla/.git bla.git\n> \tgit --git-dir=bla.git config core.bare true\n> \trm -rf bla\n> \n\nIs it simpler and more complete to do this?\n\n\tgit config core.bare true\n\tgit config core.logAllRefUpdates\n\tmv bla/.git bla.git\n\trm -rf bla\n"}]}