我的 git 工作目录中有五个文件git status
显示为已修改。当我git diff
他们时,整个文件显示为已更改。我有core.autocrlf true
,但它似乎没有效果。
当我试图从同事那里获取更改时,真正的问题浮出水面。其中一个“修改过的”文件会被合并覆盖,所以我把它们藏起来了。令我惊讶的是,变化仍然存在。
[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")
在此之后,我尝试了git reset --hard HEAD
- 结果相同。我也尝试过git checkout -- src/ourcustomer/SiteBundle/Resources/public/css/main.css
,但它也没有帮助。
这里有什么问题?有什么方法可以解决这个问题,还是我应该再次删除并克隆整个存储库?