Git tells me my files are changed, but I don't see any difference

I just installed the latest Git (1.9.5), and suddenly it tells me that my working tree is not clean (changes are not organized), but I do not see any changes in any of my files in any diff tool (I tried to create Tortoise and Visual Studio). When I run the Git status, it says:

Changes not staged for commit: (use "git add <file>..." to update what will be committed) (use "git checkout -- <file>..." to discard changes in working directory) modified: inc/i_lab_orders.asp modified: lab_order_list.asp modified: slib/lab_order_lib.asp 

However, the Git GUI diff tool tells me that all lines are changed, but I do not see any difference. Similarly with Git bash diff.

Running git reset --hard doesn't help at all - the command runs without any problems, but in the end I still have the same “modified” files.

UPDATE: core.autocrlf is false, core.fileMode is also false. I also noticed that the files that are reported to be modified are exactly those that were committed in the last commit.

I am on Windows.

+3
source share
3 answers

Welcome to Hell. Enjoy your stay :-)

The difference you do not see ends. In a nutshell, you told Git to convert all line ends to Windows or Unix, and there is a file in the repo that has different line ends in the repo.

When you check the file, Git performs the conversion, creating a local file that looks correct. When you execute diff , Git does not convert (because the file on the disk must be correct and why will it convert what is already in the repo?), And now you get differences that are not there.

Decision. Make sure Git is configured correctly for every developer who can push , commit the file once with the correct endings and get a dumb hat for those who put on those who create files with the wrong endings.

on this topic:

+5
source

The change may also be a file mod, but you can tell git to ignore something like this.

 git config core.fileMode false 

I recommend using gitk

On ubuntu just

 sudo apt-get install gitk 
+1
source

Fixed by manually deleting the .git \ rebase-merge-failed folder. Thanks to everyone for helping me.

UPDATE I also suspect the reason is because I had text=auto in my .gitattributes file.

0
source

Source: https://habr.com/ru/post/1012904/


All Articles