Commit Changes displaying "Contents are identical" when pushing changes.
已回答
Anytime I try to commit my changes, WebStorm displays 100s of files being changes, without actually being changed. I've tried multiple fixes for this problem, and none of them have worked.
Fixes I've tried:
git config --global core.autocrlf false
git config --global core.autocrlf true
git config core.autocrlf true
git config core.autocrlf false
Turning the "Warn if CRLF line separators are about to be committed" setting on AND off
None of these "fixes" have worked, and always result in the same problem no matter what.
Here's an example of what's happening:
请先登录再写评论。
And what are the actual differences in the files? What does git status in the command line say?
There are no differences in the command line.
Does calling Refresh in the Local changes before committing help?
Seems like https://youtrack.jetbrains.com/v2/issue/IDEA-124412
I had a similar problem -- the commit UI showed file changes, but the "show diff" UI indicated that the files were idential. "git status" on the command line showed that I had changed the permissions on the files (went from 100644 to 100755), which in fact, I had done a few days prior. I had forgotten that git tracks those permissions.
Had a similar issue. My problem was, idea shows modified files as staged, while git status in a shell doesnt.
So i had a file where line endings changed. Idea showed them as changed, but contents where identical.
As soon as i typed "git add myfile", this file got autocrlf'd and idea didnt show changes anymore.
I get the same issue.
How to check if permissions changed ?
I'm on a windows environment, I checked encoding / line endings, etc... file are both in UTF8-CRLF on both repos.
FOUND IT !!!
https://stackoverflow.com/questions/1580596/how-do-i-make-git-ignore-file-mode-chmod-changes
git config core.fileMode false
yeah, I'm having this problem as well and core.filemode was the first thing I thought of however, it seemed like it was having 0 effect and lead me up the garden path until I realized the IDE caches the git config! 🤦♂️.
So had to restart the IDE to stop it from being a pain.
But the added annoyance was the fact this happens on a fresh clone. The filemode shouldn't have been an issue in the first place. I suspect its to do with lack of WSL support and probably thinks all files are executable because its asking windows.
At any rate, it should tell you why. If it's line endings, SHOW IT in the diff, if it's +x bit tell us! Don't provide git integration and force us to jump through hoops to figure out why you think the file has changed.
Also if the local command line says nothing has changed it for dam sure shouldn't say it has in the IDE regardless of what the config says it should behave the same as git does.
same issue as above and Bradozman seems to be write, looks like lack of WSL support..
I changed core.filemode and also restarted the IDE and cleared cache but it didn't resolve the issue..
IDE should show what the difference is if there is one in terms of permissions, window like below tells me files are identical in every regard...
Ildarius See this comment: https://youtrack.jetbrains.com/issue/IDEA-262748#focus=Comments-27-4713130.0-0
Konstantin Annikov Hi, thank you for the link but it didn't help. I think what the ppl are also complaining about is that in
it shows a diff in file permissions like
But PHPStorm is not showing any differences in that interface which causes confusion. It would be great if PHPStorm also indicated that there's a diff in file permissions.
Btw still not sure how to fix this issue.
Double check what git is being used it often detects the wrong one (esp if you have several distros in different locations).
If the correct WSL path to git is not being used then it may not show the same results as your terminal.
Run this in the terminal and autocrlf will notice that the files are "identical".
Having the same problem after reinstalling the OS and put the project back.
I use this:
in the project and restart the PhpStorm and worked. All the files with "Contents are identical" gone and is showing me only the files that are changes in them.
Bradozman comment did the trick for me. Had the git path from windows set up in Pycharm and not the git within my wsl