From: "Lasse Kliemann" <lasse-gmane-git-2009@mail.plastictree.net>
To: git@vger.kernel.org
Subject: gitosis: how to create absolutely empty repos
Date: Wed, 25 Feb 2009 19:54:50 +0000 (UTC) [thread overview]
Message-ID: <go47ma$5n8$1@ger.gmane.org> (raw)
$ 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?
next reply other threads:[~2009-02-25 20:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-25 19:54 Lasse Kliemann [this message]
2009-02-26 9:23 ` gitosis: how to create absolutely empty repos Thomas Rast
2009-02-26 11:54 ` Lasse Kliemann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='go47ma$5n8$1@ger.gmane.org' \
--to=lasse-gmane-git-2009@mail.plastictree.net \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.