I have a problem with PhpStorm and git.
Every time when I add files from e.g. backup archives of my server, PhpStorm shows all files as changed even if the only change is the line ending and no content.
I noticed that this comes, because my git is configured to use CRLF for checked out files and LF for files in the repo (and that is what I want).
The problem comes now, when I add files that already have LF line breaks then all these files are displayed as "modified". When I do git add
on any of these files, line breaks are in the filesystem converted and git/PhpStorm discovers that these files are identical to the repo and removes the file from the "changes" list.
But when I add a whole directory with thousands of files it is a big pain to manually add all files that are not really changed. I can't add a whole folder because I first like to remove all file changes and after this see which REAL changes are in the file content.
My current config is:
core.autocrlf=true
core.safecrlf=false
My question is:
Is there a way to disable the function where files are displayed as "changed" even if adding them to git will not add any changes (but keep the behavior that files in Windows have CRLF and files in repo LF)?
I already found that I can disable the "LF will be replaced by CRLF" warning in command line git, by setting core.safecrlf=false
. But the files are still displayed as "changed" in PhpStorm and git status
.
I found a similar question for command line git: Git status ignore line endings / identical files / windows & linux environment / dropbox / meld but none of the solutions worked for me.