【问题标题】:I changed my line endings settings in Git. I still can't stage files due to line endings in SourceTree我在 Git 中更改了行尾设置。由于 SourceTree 中的行结尾,我仍然无法暂存文件
【发布时间】:2016-12-14 00:36:59
【问题描述】:

我使用了这个全局设置:

$ git config --global core.autocrlf input

在我的 OSX 系统上应该在 LF 中留下行尾。然后我尝试在 sourcetree 中暂存文件,但收到但收到此致命错误:

致命:CRLF 将在...中被 LF 替换

据我了解,我想在我的 OSX 系统上将 CRLF 转换为 LF,对吗?上面的 git cmd 不正确吗?为什么我会在 SourceTree 中收到此致命错误?另外,我讨厌 git。

【问题讨论】:

    标签: git macos atlassian-sourcetree


    【解决方案1】:

    这解决了我的问题(可能除了 Benjamin Close 的帖子之外)。不知道为什么。

    $ git config --global core.autocrlf false
    $ git config --global core.safecrlf false
    

    git commit get fatal error "fatal: CRLF would be replaced by LF in"

    【讨论】:

      【解决方案2】:

      有说明here,为您提供有关如何解决问题的详细信息。您需要重置索引并提交固定文件,然后才能继续进行更改。

      【讨论】:

      • 我相信这个建议可能是最好的,但它并没有解决我的问题。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-06-29
      • 1970-01-01
      • 2021-06-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多