Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git is showing files as changed, even though files are byte-for-byte identical

Tags:

git

Git is indicating that a file has changes. However, when I run git difftool and open the file in Beyond Compare, it shows the files as binary-identical. Even if I open Beyond Compare in hex-mode, it still shows the files as identical.

I'm running git 2.9.2.windows.1 on Windows 10. I see this issue both when I run git from PowerShell and from the msys git bash prompt.

Has anyone else ever seen this before? Note: I'm not talking about changes in line endings, since line ending differences would clearly be visible in a hex comparison of the files.

like image 769
quanticle Avatar asked Oct 20 '25 04:10

quanticle


1 Answers

That could be a change in the file mode, aka Unix mode bits. Even on Windows (which does not have Unix mode bits) Git does track the file mode which could change e.g. by running git update-index --chmod=+x <filename>. You can double-check by running git status -v which in this case would display something like

$ git status -v
On branch version-defines
Your branch is up-to-date with 'origin/version-defines'.
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

        modified:   circle.yml

diff --git a/circle.yml b/circle.yml
old mode 100644
new mode 100755
like image 61
sschuberth Avatar answered Oct 22 '25 17:10

sschuberth