From: Di Xu Date: Sat, 12 Oct 2013 10:36:39 GMT Subject: Re: BUG - git clean Message-ID: In-Reply-To: <52584914.6030103@gmail.com> > mkdir test > cd test > git init . > mkdir ba > mkdir ba/ca > > # So far so good. > # Should clean directory "ba/ca" > git clean -dn -- ba/ca > > # Should clean "ba/ca" and ignore non-existent "j" > # Instead, it wants to delete "ba" totally. > git clean -dn -- ba/ca j actually, my git will also do it wrong when 'j' exist, do these after your script: $ git clean -dn ba/ca j Would remove ba/ $ mkdir j $ git clean -dn ba/ca j Would remove ba/ #here missing 'ca' Would remove j/ I think it's the problem of directory path manipulation.