{"thread":{"id":"40547","subject":"Why does \"git reset --hard\" fail on file/folder conflicts?","startedAt":"2015-10-13T06:36:20Z","lastAt":"2015-10-13T06:36:20Z","messageCount":1,"participants":["Christian Halstrick"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"271556","messageId":"CAENte7i8jv5ET7v15HS-4bqbaGpdNkHFyX7upMHAmc0ykd1Mjw@mail.gmail.com","threadId":"40547","inReplyTo":null,"subject":"Why does \"git reset --hard\" fail on file/folder conflicts?","fromName":"Christian Halstrick","fromEmail":"christian.halstrick@gmail.com","sentAt":"2015-10-13T06:36:20Z","receivedAt":"2015-10-13T06:36:20Z","isPatch":false,"sender":{"key":"christian.halstrick@gmail.com","avatar":"https://gravatar.com/avatar/3598bf518644c7dc32d4dcd8e0554b6a313e12103011862402c83ae2854203ce?d=mp&s=160"},"body":"Hi,\n\ngit doesn't want to do a git reset hard when for a certain path the index\ncontains a tree, worktree contains a file and the commit to reset to\ncontains nothing. Is it a bug or is it intended? I would expect git to\nsimply delete that path from index and worktree.\n\n> git init\nInitialized empty Git repository in /tmp/y/.git/\n> touch a\n> git add a\n> git commit -m addA\n[master (root-commit) fa08136] addA\n 1 file changed, 0 insertions(+), 0 deletions(-)\n create mode 100644 a\n> mkdir d\n> touch d/f\n> git add d/f\n> rm -fr d\n> touch d\n> git reset --hard HEAD\nwarning: unable to unlink d/f: Not a directory\nHEAD is now at fa08136 addA\n\nCiao\n  Chris\n"}]}