{"thread":{"id":"9640","subject":"How-to setup an empty remote repository?","startedAt":"2007-08-25T21:00:33Z","lastAt":"2007-09-04T19:47:49Z","messageCount":4,"participants":["Wink Saville","Petr Baudis","Jan Hudec"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"51521","messageId":"d4cf37a60708251400t17b0a097t91f77cbb4e996810@mail.gmail.com","threadId":"9640","inReplyTo":null,"subject":"How-to setup an empty remote repository?","fromName":"Wink Saville","fromEmail":"wink@saville.com","sentAt":"2007-08-25T21:00:33Z","receivedAt":"2007-08-25T21:00:33Z","isPatch":false,"sender":{"key":"wink@saville.com","avatar":"https://avatars.githubusercontent.com/u/1024284?v=4"},"body":"Hello,\n\nI thought I'd try to setup a shared \"empty\" remote repository and then\nclone it and then push the initial commit from another maching.\nThis failed as shown below:\n\n $ cd ~/git-repos\n $ mkdir test.git\n $ cd test.git\n $ git --bare init --shared\n Initialized empty shared Git repository in /home/wink/git-repos/test.git/\n $ git-daemon --reuseaddr --verbose --base-path=/home/wink/git-repos \\\n    --export-all --enable=receive-pack\n\nOn my other machine:\n\n$ git clone git://192.168.0.8/test.git\nInitialized empty Git repository in /home/wink/prgs/test/.git/\nfatal: no matching remote head\nfetch-pack from 'git://192.168.0.8/test.git' failed.\n$\n\nAnd the remote machine responded:\n\n[27299] Connection from 192.168.0.133:56710\n[27299] Extended attributes (18 bytes) exist <host=192.168.0.8>\n[27299] Request upload-pack for '/test.git'\n[27299] Disconnected\n\nIn the instructions I followed for setting up a remote repository,\nhttp://www.kernel.org/pub/software/scm/git/docs/cvs-migration.html,\nit uses an existing repository. So is it true you can't clone an\nempty remote repository, or did I do something wrong?\n\nI'm using :\n$ git --version\ngit version 1.5.3.rc6.23.g0058\n\nNote, my reason for using the shared remote repository is to make it\nsimple and easy to backup my repository on a second machine and\nit seemed reasonable to try a an empty repository.\n\nCheers,\n\nWink Saville\n"},{"id":"51523","messageId":"20070825220629.GC1219@pasky.or.cz","threadId":"9640","inReplyTo":"d4cf37a60708251400t17b0a097t91f77cbb4e996810@mail.gmail.com","subject":"Re: How-to setup an empty remote repository?","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2007-08-25T22:06:29Z","receivedAt":"2007-08-25T22:06:29Z","isPatch":false,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"On Sat, Aug 25, 2007 at 11:00:33PM CEST, Wink Saville wrote:\n> In the instructions I followed for setting up a remote repository,\n> http://www.kernel.org/pub/software/scm/git/docs/cvs-migration.html,\n> it uses an existing repository. So is it true you can't clone an\n> empty remote repository, or did I do something wrong?\n\nIt is true that you can't clone it. \"Cloning remote repository\" means\njust \"get all the remote branches and set them up locally\". In empty\nrepository there are no branches yet, so there's nothing to clone.\n\nI guess this should be covered in the FAQ (if it isn't already), it is\none of the top questions repo.or.cz users have and I think I see it\nfrequently on IRC as well.\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nEver try. Ever fail. No matter. // Try again. Fail again. Fail better.\n\t\t-- Samuel Beckett\n"},{"id":"51532","messageId":"d4cf37a60708251545m7911e346m18fc183da48b4e63@mail.gmail.com","threadId":"9640","inReplyTo":"20070825220629.GC1219@pasky.or.cz","subject":"Re: How-to setup an empty remote repository?","fromName":"Wink Saville","fromEmail":"wink@saville.com","sentAt":"2007-08-25T22:45:44Z","receivedAt":"2007-08-25T22:45:44Z","isPatch":false,"sender":{"key":"wink@saville.com","avatar":"https://avatars.githubusercontent.com/u/1024284?v=4"},"body":"On 8/25/07, Petr Baudis <pasky@suse.cz> wrote:\n> On Sat, Aug 25, 2007 at 11:00:33PM CEST, Wink Saville wrote:\n> > In the instructions I followed for setting up a remote repository,\n> > http://www.kernel.org/pub/software/scm/git/docs/cvs-migration.html,\n> > it uses an existing repository. So is it true you can't clone an\n> > empty remote repository, or did I do something wrong?\n>\n> It is true that you can't clone it. \"Cloning remote repository\" means\n> just \"get all the remote branches and set them up locally\". In empty\n> repository there are no branches yet, so there's nothing to clone.\n>\n> I guess this should be covered in the FAQ (if it isn't already), it is\n> one of the top questions repo.or.cz users have and I think I see it\n> frequently on IRC as well.\n>\n> --\n\nI didn't see it here, http://git.or.cz/gitwiki/GitFaq.\n\nI would have expected it to setup an empty repository and then\npopulate it with 0 remote branches. Obviously, its a corner case\nand maybe doesn't need addressing but if it is asked a lot then\nmaybe it should work that way.\n\nThanks,\n\nWink\n"},{"id":"52508","messageId":"20070904194749.GB3786@efreet.light.src","threadId":"9640","inReplyTo":"d4cf37a60708251400t17b0a097t91f77cbb4e996810@mail.gmail.com","subject":"Re: How-to setup an empty remote repository?","fromName":"Jan Hudec","fromEmail":"bulb@ucw.cz","sentAt":"2007-09-04T19:47:49Z","receivedAt":"2007-09-04T19:47:49Z","isPatch":false,"sender":{"key":"bulb@ucw.cz","avatar":null},"body":"On Sat, Aug 25, 2007 at 14:00:33 -0700, Wink Saville wrote:\n> Hello,\n> \n> I thought I'd try to setup a shared \"empty\" remote repository and then\n> clone it and then push the initial commit from another maching.\n> This failed as shown below:\n> \n>  $ cd ~/git-repos\n>  $ mkdir test.git\n>  $ cd test.git\n>  $ git --bare init --shared\n>  Initialized empty shared Git repository in /home/wink/git-repos/test.git/\n>  $ git-daemon --reuseaddr --verbose --base-path=/home/wink/git-repos \\\n>     --export-all --enable=receive-pack\n> \n> On my other machine:\n> \n> $ git clone git://192.168.0.8/test.git\n> Initialized empty Git repository in /home/wink/prgs/test/.git/\n> fatal: no matching remote head\n> fetch-pack from 'git://192.168.0.8/test.git' failed.\n> $\n\nDid it configure the repository though? Like setting the url and tracking\nbranches for origin? If it did, it actually did all you needed, so you can\ncount it as success (and the message should talk about having nothing to do\nrather than failing).\n\n-- \n\t\t\t\t\t\t Jan 'Bulb' Hudec <bulb@ucw.cz>\n"}]}