git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* gitosis: how to create absolutely empty repos
@ 2009-02-25 19:54 Lasse Kliemann
  2009-02-26  9:23 ` Thomas Rast
  0 siblings, 1 reply; 3+ messages in thread
From: Lasse Kliemann @ 2009-02-25 19:54 UTC (permalink / raw)
  To: git

$ mkdir test
$ cd test
$ git init
Initialized empty Git repository in /home/foo/new-repos/test/.git/
$ git remote add origin ext:test.git

('ext' is configured in ~/.ssh/config to be my git user and host.)

Here the docs say to add some files and to do a commit. However, 
I want an absolutely empty repos created, so I skip this step.

$ git push origin master:refs/heads/master
Initialized empty Git repository in /home/git/repositories/test.git/
error: src refspec master does not match any.
fatal: The remote end hung up unexpectedly
error: failed to push some refs to 'ext:test.git'

So, this did not work. It will work, however, if I do at least 
one commit. A way to do this without adding files is the 
following:

$ git commit --allow-empty

Then the push will work:

$ git push origin master:refs/heads/master
Counting objects: 2, done.
Writing objects: 100% (2/2), 168 bytes, done.
Total 2 (delta 0), reused 0 (delta 0)
To ext:test.git
 * [new branch]      master -> master

Is there a better way to do it?

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-02-26 11:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-25 19:54 gitosis: how to create absolutely empty repos Lasse Kliemann
2009-02-26  9:23 ` Thomas Rast
2009-02-26 11:54   ` Lasse Kliemann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).