PhpStorm + GIT line endings changing from LF to CRLF

I set the end of the FpStorm line to LF, but when I pass github, sometimes I see some of the files appear again with the end of the CRLF line (I work on Windows).

This happens with the same files that I edited, and no one edited them between my commits / clicks to the repository. This is very annoying, and I often need to change the ends of the lines in the same file. What can it be and how to fix it?

I also checked the option "Warn that CRLF line separators will be committed"

EDIT

My local git config:

[core] repositoryformatversion = 0 filemode = false bare = false logallrefupdates = true symlinks = false ignorecase = true hideDotFiles = dotGitOnly [remote "origin"] url = https://github.com/* fetch = +refs/heads/*:refs/remotes/origin/* [branch "develop"] remote = origin merge = refs/heads/develop 

My global configuration is as follows:

 [user] name = * email = * [core] autocrlf = false 

My system configuration is as follows:

 [core] symlinks = false autocrlf = false [color] diff = auto status = auto branch = auto interactive = true [pack] packSizeLimit = 2g [help] format = html [http] sslCAinfo = /bin/curl-ca-bundle.crt [sendemail] smtpserver = /bin/msmtp.exe [diff "astextplain"] textconv = astextplain [rebase] autosquash = true 

And my git settings in PhpStorm:

My Git Settings in PhpStorm

+6
source share
3 answers

After the tests, this is clearly not a problem with PhpStorm, but a problem with the GIT configuration.

Windows seems to need to install:

 git config --global core.autocrlf input 

but also

 git config --global core.eol lf 

for it to work.

+4
source

You can check if this Git option can help:

 git config --global core.autocrlf false 

I usually recommend keeping core.autocrlf false (there is only one reason to set it to true ).

Also check if you have .gitattributes files with the core.eol directive.

+8
source

git config --global core.autocrlf input will provide LF only for all git projects.

+1
source

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


All Articles