{"thread":{"id":"18019","subject":"gitosis: how to create absolutely empty repos","startedAt":"2009-02-25T19:54:50Z","lastAt":"2009-02-26T11:54:20Z","messageCount":3,"participants":["Lasse Kliemann","Thomas Rast"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"106248","messageId":"go47ma$5n8$1@ger.gmane.org","threadId":"18019","inReplyTo":null,"subject":"gitosis: how to create absolutely empty repos","fromName":"Lasse Kliemann","fromEmail":"lasse-gmane-git-2009@mail.plastictree.net","sentAt":"2009-02-25T19:54:50Z","receivedAt":"2009-02-25T19:54:50Z","isPatch":false,"sender":{"key":"lasse-gmane-git-2009@mail.plastictree.net","avatar":null},"body":"$ mkdir test\n$ cd test\n$ git init\nInitialized empty Git repository in /home/foo/new-repos/test/.git/\n$ git remote add origin ext:test.git\n\n('ext' is configured in ~/.ssh/config to be my git user and host.)\n\nHere the docs say to add some files and to do a commit. However, \nI want an absolutely empty repos created, so I skip this step.\n\n$ git push origin master:refs/heads/master\nInitialized empty Git repository in /home/git/repositories/test.git/\nerror: src refspec master does not match any.\nfatal: The remote end hung up unexpectedly\nerror: failed to push some refs to 'ext:test.git'\n\nSo, this did not work. It will work, however, if I do at least \none commit. A way to do this without adding files is the \nfollowing:\n\n$ git commit --allow-empty\n\nThen the push will work:\n\n$ git push origin master:refs/heads/master\nCounting objects: 2, done.\nWriting objects: 100% (2/2), 168 bytes, done.\nTotal 2 (delta 0), reused 0 (delta 0)\nTo ext:test.git\n * [new branch]      master -> master\n\nIs there a better way to do it?\n"},{"id":"106307","messageId":"200902261023.46700.trast@student.ethz.ch","threadId":"18019","inReplyTo":"go47ma$5n8$1@ger.gmane.org","subject":"Re: gitosis: how to create absolutely empty repos","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2009-02-26T09:23:43Z","receivedAt":"2009-02-26T09:23:43Z","isPatch":false,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"Lasse Kliemann wrote:\n> Here the docs say to add some files and to do a commit. However, \n> I want an absolutely empty repos created, so I skip this step.\n> \n> $ git push origin master:refs/heads/master\n> Initialized empty Git repository in /home/git/repositories/test.git/\n> error: src refspec master does not match any.\n> fatal: The remote end hung up unexpectedly\n> error: failed to push some refs to 'ext:test.git'\n\nYou can do \"anything\" to the repository and gitosis will create it.\nFor example, doing an invalid push will work (you'll need to do this\nin a git repository to make git-push happy, but it doesn't matter what\nit contains):\n\n  git push gitosis@server.example.com:repo.git :master\n\nNote that _cloning_ such a repository is only possible since 86ac751\n(Allow cloning an empty repository, 2009-01-23), which is not in any\nreleased version yet, but will be in 1.6.2.\n\n-- \nThomas Rast\ntrast@{inf,student}.ethz.ch\n"},{"id":"106318","messageId":"go5vtc$3dj$1@ger.gmane.org","threadId":"18019","inReplyTo":"200902261023.46700.trast@student.ethz.ch","subject":"Re: gitosis: how to create absolutely empty repos","fromName":"Lasse Kliemann","fromEmail":"lasse-gmane-git-2009@mail.plastictree.net","sentAt":"2009-02-26T11:54:20Z","receivedAt":"2009-02-26T11:54:20Z","isPatch":false,"sender":{"key":"lasse-gmane-git-2009@mail.plastictree.net","avatar":null},"body":"Thomas Rast <trast@student.ethz.ch> writes:\n\nThank you for your reply!\n\n> You can do \"anything\" to the repository and gitosis will create it.\n> For example, doing an invalid push will work (you'll need to do this\n> in a git repository to make git-push happy, but it doesn't matter what\n> it contains):\n> \n>  git push gitosis@server.example.com:repo.git :master\n> \n> Note that _cloning_ such a repository is only possible since 86ac751\n> (Allow cloning an empty repository, 2009-01-23), which is not in any\n> released version yet, but will be in 1.6.2.\n\nNot sure if it's the same, but cloning a local repository just initialized \nwith 'git init' seems to work; it only gives a warning: \"warning: remote HEAD \nrefers to nonexistent ref, unable to checkout.\" Using git version 1.6.1.3.\n"}]}