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

From: Imre Deak <hidden>
Date: 2016-06-15 22:45:27
Subsystem: the rest · Maintainer: Linus Torvalds

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

Creating a hypothetical mbox patch:

$ echo "From: imre deak [off-list ref]" > 1.patch
$ touch a
$ git diff --no-index /dev/null a >> 1.patch
$ cat 1.patch
From: imre deak <redacted>
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help