Subject: Re: New directory lost by git am

From: Phillip Susi <[email-masked]>
Date: Tue, 04 Mar 2014 22:22:16 -0500

On 03/04/2014 10:08 PM, Chris Packham wrote:
> Could you provide a few more details such as your git version (git 
> --version) and an example of the failure. I've tried to reproduce
> the problem based on the description provided but everything seems
> to work as expected for me.

Version 1.8.3.2.

> git --version git version 1.9.0 mkdir test && cd test && git init 
> echo "hello world" >a.txt git add a.txt git commit -m"Initial
> commit" git checkout -b temp mkdir b echo "lorem ipsum" >b/b.txt 
> git add b/b.txt git commit -m"Add b/b.txt" ls -R .: a.txt  b
> 
> ./b: b.txt git checkout master git format-patch temp -1 --stdout |
> git am ls -R .: a.txt  b
> 
> ./b: b.txt
> 

You are reapplying the patch while it is already applied.  Do a reset
HEAD~1 --hard, and git clean -x -f -d before git am.  I didn't notice
the missing file myself for some time because it is left in the
working tree, just not added to the index and included in the commit.