tags:

views:

55

answers:

2

After the directory TestDirectory was renamed to lower case (testdirectory) all it's files (a.html and b.html) are shown as modified and even git reset --hard doesn't reset the working tree.

Git always says:

#   modified:   TestDirectory/a.html
#   modified:   TestDirectory/b.html

Nothing works to reset the working tree to unmodified state, none of following commands help:

git reset --hard

git checkout -- TestDirectory/a.html

I don't understand why this happens and what I can do. Is it git bug?

The rename wasn't added by me but another git user.

git version 1.6.4

I am running Mac OS X 10.6

A: 

You could check if git rewrote line endings (git diff shows the file replaced by itself, only with different line endings). When this is the case, you should look at http://stackoverflow.com/questions/170961/whats-the-best-crlf-handling-strategy-with-git.

Rudi
A: 

After playing about an hour my solution was to delete testdirectory/a.html and testdirectory/b.html manually - after that git reported them as "deleted" (I don't want to delete them actually) but it gave me ability to do git pull and get changes when problem was fixed by another user.

Shortly steps:

  1. Delete files testdirectory/a.html and testdirectory/b.html
  2. git pull

Note: previously git pull couldn't be done cause merge conflict error.

I didn't clearly understand what's happend but it solved my case. In my opinion Git is still quite complicated like Perl and commands mostly reflects the internals of git rather than user intentions :-)

Vladimir