微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

PhpStorm GIT线路结尾从LF变为CRLF

我已经将我的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文件.

原文地址:https://www.jb51.cc/php/132789.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐