{"thread":{"id":"22488","subject":"git am fails to add new files","startedAt":"2010-02-02T15:07:25Z","lastAt":"2010-02-03T15:33:01Z","messageCount":2,"participants":["Thomas Koch","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"133359","messageId":"201002021607.25719.thomas@koch.ro","threadId":"22488","inReplyTo":null,"subject":"git am fails to add new files","fromName":"Thomas Koch","fromEmail":"thomas@koch.ro","sentAt":"2010-02-02T15:07:25Z","receivedAt":"2010-02-02T15:07:25Z","isPatch":false,"sender":{"key":"thomas@koch.ro","avatar":null},"body":"Hi,\n\nI'm using GIT on Debian unstable (1.6.6.1). When applying patches I created \nwith git format-patch and applying them afterwards with git am, this fails \nwith every patch that adds a new file.\nIs there any option I forgot to give to git am? Or is this a bug.\n\nBest regards,\n\nThomas Koch, http://www.koch.ro\n"},{"id":"133473","messageId":"20100203153301.GA29692@coredump.intra.peff.net","threadId":"22488","inReplyTo":"201002021607.25719.thomas@koch.ro","subject":"Re: git am fails to add new files","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2010-02-03T15:33:01Z","receivedAt":"2010-02-03T15:33:01Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Feb 02, 2010 at 04:07:25PM +0100, Thomas Koch wrote:\n\n> I'm using GIT on Debian unstable (1.6.6.1). When applying patches I created \n> with git format-patch and applying them afterwards with git am, this fails \n> with every patch that adds a new file.\n> Is there any option I forgot to give to git am? Or is this a bug.\n\nNo, it should just work. However, I can't replicate your problem using\nthe following script:\n\nmkdir repo && cd repo && git init &&\necho 1 >file-1 && git add . && git commit -m one &&\necho 2 >file-2 && git add . && git commit -m two &&\ngit format-patch -1 --stdout >patch &&\ngit reset --hard HEAD^ &&\necho Confirm that file-2 is gone... &&\n! grep . file-2 &&\ngit am patch &&\necho Confirm that file-2 is back... &&\ngrep . file-2\n\nSo perhaps there is something else going on. Can you provide us with\nsamples of the patches that fail to apply? What does \"git am\" say when\nit tries to apply?\n\n-Peff\n"}]}