加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

PhpStorm GIT线路结尾从LF变为CRLF

发布时间:2020-12-13 16:27:34 所属栏目:PHP教程 来源:网络整理
导读:我已经将我的PhpStorm行结尾设置为LF,但是当我提交 github时,有时我会看到一些文件再次出现在CRLF行结尾(我在 Windows上工作). 它发生在我编辑的相同文件中,没有人在我的提交/推送到存储库之间编辑它们.这非常烦人,我需要经常将行结尾更改为同一个文件.它可
我已经将我的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设置:

您可以检查此Git设置是否有帮助:
git config --global core.autocrlf false

我通常建议keeping core.autocrlf to false(有only a few reason to set it to true).

还要检查是否有任何带有core.eol指令的.gitattributes文件.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读