作者:小情冒_256 | 来源:互联网 | 2023-05-28 18:43
我已经将我的PhpStorm行结尾设置为LF,但是当我提交github时,有时我会看到一些文件再次出现在CRLF行结尾(我在Windows上工作).
它发生在我编辑的相同文件中,没有人在我的提交/推送到存储库之间编辑它们.这非常烦人,我需要经常将行结尾更改为同一个文件.它可能是什么以及如何解决它?
我也检查了选项"如果要提交CRLF行分隔符就警告"
编辑
我的本地git配置是这样的:
[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
我的全局配置是这样的:
[user]
name = *
email = *
[core]
autocrlf = false
我的系统范围配置是这样的:
[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
我在PhpStorm中的GIT设置:
1> VonC..:
您可以检查此Git设置是否有帮助:
git config --global core.autocrlf false
我通常建议保持core.autocrlf
为假(只有几个原因将其设置为true).
检查是否有任何.gitattributes
带有core.eol
指令的文件.
2> Marcin Nabia..:
经过测试,显然不是PhpStorm问题,而是GIT配置问题.
似乎在Windows上有必要设置:
git config --global core.autocrlf input
但是也
git config --global core.eol lf
使它工作.