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

Re: git am fails to add new files

From
Jeff King <peff@peff.net>
Date
Feb 3, 2010, 15:33 UTC
Message-ID
<20100203153301.GA29692@coredump.intra.peff.net>
In-Reply-To
<201002021607.25719.thomas@koch.ro>
On Tue, Feb 02, 2010 at 04:07:25PM +0100, Thomas Koch wrote:
> I'm using GIT on Debian unstable (1.6.6.1). When applying patches I created 
> with git format-patch and applying them afterwards with git am, this fails 
> with every patch that adds a new file.
> Is there any option I forgot to give to git am? Or is this a bug.

No, it should just work. However, I can't replicate your problem using the following script:

mkdir repo && cd repo && git init && echo 1 >file-1 && git add . && git commit -m one && echo 2 >file-2 && git add . && git commit -m two && git format-patch -1 --stdout >patch && git reset --hard HEAD^ && echo Confirm that file-2 is gone... && ! grep . file-2 && git am patch && echo Confirm that file-2 is back... && grep . file-2

So perhaps there is something else going on. Can you provide us with samples of the patches that fail to apply? What does "git am" say when it tries to apply?

-Peff
Previous: Thomas Koch
Message 2 of 2 in “git am fails to add new files”
  1. Thomas KochFeb 2, 2010
  2. Jeff KingFeb 3, 2010

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.