git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: gitosis: how to create absolutely empty repos

From
Thomas Rast <trast@student.ethz.ch>
Date
Feb 26, 2009, 09:23 UTC
Message-ID
<200902261023.46700.trast@student.ethz.ch>
In-Reply-To
<go47ma$5n8$1@ger.gmane.org>
Lasse Kliemann wrote:
Show 8 quoted lines
> 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'

You can do "anything" to the repository and gitosis will create it. For example, doing an invalid push will work (you'll need to do this in a git repository to make git-push happy, but it doesn't matter what it contains):

  git push gitosis@server.example.com:repo.git :master

Note that _cloning_ such a repository is only possible since 86ac751 (Allow cloning an empty repository, 2009-01-23), which is not in any released version yet, but will be in 1.6.2.

-- 
Thomas Rast
trast@{inf,student}.ethz.ch
Previous: Lasse KliemannNext: Lasse Kliemann
Message 2 of 3 in “gitosis: how to create absolutely empty repos”
  1. Lasse KliemannFeb 25, 2009
  2. Thomas RastFeb 26, 2009
  3. Lasse KliemannFeb 26, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.