I have five files in my git working directory that git status
shows as modified. When I git diff
them, the whole file shows as changed. I have core.autocrlf true
but it seems to have no effect.
The real problem surfaced when I tried to pull changes from a colleague. One of the "modified" files would have been overwritten by the merge so I stashed them. To my surprise, the changes were still there.
[dev@carbon:/var/www/html/ourcustomer]$ git stash
Saved working directory and index state WIP on master: ccb93db Merge remote branch 'origin/master'
HEAD is now at ccb93db Merge remote branch 'origin/master'
[dev@carbon:/var/www/html/ourcustomer]$ git status
# On branch master
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: src/ourcustomer/SiteBundle/Resources/public/css/main.css
# modified: src/ourcustomer/SiteBundle/Resources/public/js/main.js
# modified: src/ourcustomer/SiteBundle/Resources/public/js/ourcompany-resize.js
# modified: src/ourcustomer/SiteBundle/Resources/views/Login/languageSelector.html.twig
# modified: src/ourcustomer/SiteBundle/Resources/views/layout.html.twig
#
no changes added to commit (use "git add" and/or "git commit -a")
After this, I tried git reset --hard HEAD
- same result. I also tried to git checkout -- src/ourcustomer/SiteBundle/Resources/public/css/main.css
, but it didn't help either.
What could be wrong here? Is there some way to fix this or should I just delete and clone the whole repository again?