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

git-am: can't apply to an empty repository

From
Imre Deak <imre.deak@gmail.com>
Date
Oct 8, 2008, 13:24 UTC
Message-ID
<500f3d130810080624g23b4ed1ckde5d63082dca9040@mail.gmail.com>

When trying to build a repository from mbox format patches I have the following problem:

Creating a hypothetical mbox patch:
$ echo "From: imre deak <imre.deak@gmail.com>" > 1.patch
$ touch a
$ git diff --no-index /dev/null a >> 1.patch
$ cat 1.patch
From: imre deak <imre.deak@gmail.com>
diff --git a/a b/a
new file mode 100644
index 0000000..e69de29

Apply it to a newly created repository:

$ git init
Initialized empty Git repository in /home/imde/conv/git/.git/
$ git am 1.patch
fatal: HEAD: not a valid SHA1
fatal: bad revision 'HEAD'

Is this supposed to work at all?

--Imre
Message 1 of 1 in “git-am: can't apply to an empty repository”
  1. Imre DeakOct 8, 2008

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.