{"thread":{"id":"13067","subject":"how to use two bare repositories?","startedAt":"2008-04-11T22:22:05Z","lastAt":"2008-04-11T23:23:37Z","messageCount":4,"participants":["Oliver Kullmann","Junio C Hamano","Jean-Luc Herren"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"74154","messageId":"20080411222205.GN29940@cs-wsok.swansea.ac.uk","threadId":"13067","inReplyTo":null,"subject":"how to use two bare repositories?","fromName":"Oliver Kullmann","fromEmail":"o.kullmann@swansea.ac.uk","sentAt":"2008-04-11T22:22:05Z","receivedAt":"2008-04-11T22:22:05Z","isPatch":false,"sender":{"key":"o.kullmann@swansea.ac.uk","avatar":null},"body":"Hi,\n\nI have the following problem:\n\nWe use a public repository, a bare repository A,\nused with push and pull via ssh.\nA is only to be used by the core developer group.\n\nNow I want to create another public repository B,\nfrom which anonymous pull is possible via http.\nSo B should be another bare repository.\n\nThe problem is now that it seems not to be possible\nto update B:\n\n1. pulling from A is not possible since B is bare;\n2. fetching from A seems to work, checking the content of\n   B via gitk seems to indicate that B has been updated\n --- however pulling from B doesn't work: The newly\n fetched changes are not transported to a repository\n which pulls from B ???\n\nHope somebody can shed light on this behaviour.\n\nThanks!\n\nOliver\n"},{"id":"74156","messageId":"7v7if4ouan.fsf@gitster.siamese.dyndns.org","threadId":"13067","inReplyTo":"20080411222205.GN29940@cs-wsok.swansea.ac.uk","subject":"Re: how to use two bare repositories?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-04-11T23:17:52Z","receivedAt":"2008-04-11T23:17:52Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Oliver Kullmann <O.Kullmann@swansea.ac.uk> writes:\n\n> Now I want to create another public repository B,\n> from which anonymous pull is possible via http.\n> So B should be another bare repository.\n>\n> The problem is now that it seems not to be possible\n> to update B:\n>\n> 1. pulling from A is not possible since B is bare;\n> 2. fetching from A seems to work, checking the content of\n>    B via gitk seems to indicate that B has been updated\n>  --- however pulling from B doesn't work\n\nThe usual answer when you see a word \"http\" mentioned is...\n\n\thow are you arranging update-server-info to be run whenever B is\n\tupdated?\n"},{"id":"74157","messageId":"47FFF219.1080707@gmx.ch","threadId":"13067","inReplyTo":"20080411222205.GN29940@cs-wsok.swansea.ac.uk","subject":"Re: how to use two bare repositories?","fromName":"Jean-Luc Herren","fromEmail":"jlh@gmx.ch","sentAt":"2008-04-11T23:19:53Z","receivedAt":"2008-04-11T23:19:53Z","isPatch":false,"sender":{"key":"jlh@gmx.ch","avatar":null},"body":"Oliver Kullmann wrote:\n> I have the following problem:\n> \n> We use a public repository, a bare repository A,\n> used with push and pull via ssh.\n> A is only to be used by the core developer group.\n> \n> Now I want to create another public repository B,\n> from which anonymous pull is possible via http.\n> So B should be another bare repository.\n> \n> The problem is now that it seems not to be possible\n> to update B:\n> \n> 1. pulling from A is not possible since B is bare;\n> 2. fetching from A seems to work, checking the content of\n>    B via gitk seems to indicate that B has been updated\n>  --- however pulling from B doesn't work: The newly\n>  fetched changes are not transported to a repository\n>  which pulls from B ???\n\nProbably in your setup, B is tracking A as a remote and if you\nfetch, only those remotes are updated, but not the local branches\nin B.  If you then clone from B, you don't get B's remotes, you\nget B's branches.  You probably want to do this:\n\npath/to/B$ git remote rm origin\npath/to/B$ git remote add --mirror origin path/to/A\n\nThough, I wonder if it makes sense to have a 'git clone --bare'\nset up the remote in mirror mode by default.  I'm unsure of what\nuse remotes are in a bare repo.\n\njlh\n"},{"id":"74159","messageId":"20080411232337.GO29940@cs-wsok.swansea.ac.uk","threadId":"13067","inReplyTo":"20080411222205.GN29940@cs-wsok.swansea.ac.uk","subject":"Re: how to use two bare repositories?","fromName":"Oliver Kullmann","fromEmail":"o.kullmann@swansea.ac.uk","sentAt":"2008-04-11T23:23:37Z","receivedAt":"2008-04-11T23:23:37Z","isPatch":false,"sender":{"key":"o.kullmann@swansea.ac.uk","avatar":null},"body":"Just adding a further question:\n\nApparently bare repositories are strange things,\nwhich perhaps are not really supported by git.\nAlright, then I use additionally a real repository C.\n\nNow in the automated process of package generation,\nthe user of my library gets always a clone of C,\ncreated by\n\ngit clone --no-hardlinks path-to-C\n\nHowever having the origin C built into that clone\nis not really useful, since no user has access to C.\nThe natural think to do would be to use instead\n\ngit clone --no-hardlinks --origin http:address-of-B path-to-C\n\nbut unfortunately \n\ngit complains that \"http:address-of-B\" is not suitable\nas an origin??\n\nHowever \"http:address-of-B\" works for pull ?\n\nIf option \"origin\" doesn't work, how else is it possible\nto provide the package-clone with a sensible default value\nfor the pull-operation (this can only be B here)?\n\nOliver\n\n\nOn Fri, Apr 11, 2008 at 11:22:05PM +0100, Oliver Kullmann wrote:\n> Hi,\n> \n> I have the following problem:\n> \n> We use a public repository, a bare repository A,\n> used with push and pull via ssh.\n> A is only to be used by the core developer group.\n> \n> Now I want to create another public repository B,\n> from which anonymous pull is possible via http.\n> So B should be another bare repository.\n> \n> The problem is now that it seems not to be possible\n> to update B:\n> \n> 1. pulling from A is not possible since B is bare;\n> 2. fetching from A seems to work, checking the content of\n>    B via gitk seems to indicate that B has been updated\n>  --- however pulling from B doesn't work: The newly\n>  fetched changes are not transported to a repository\n>  which pulls from B ???\n> \n> Hope somebody can shed light on this behaviour.\n> \n> Thanks!\n> \n> Oliver\n> \n> --\n"}]}