【问题标题】:Github showing entire file on Single LineGithub 在单行上显示整个文件
【发布时间】:2017-02-23 20:46:13
【问题描述】:

在 git bash 中提交后,我去 GitHub 上验证代码,发现更改的文件如下所示:

<?php^M^Mrequire_once GLOBAL_INCLUDES . DS . "api.php";^M^Mclass MyAPI extends API {^M^Mprotected $User;   // continues for a long time on this line, a 1000 line file all to the right of this --->

显然这是^M^M 的行尾问题(或者至少我认为这很明显?)

此后,我尝试使用 github 的说明对整个项目中的所有行进行规范化。我做了git config --global core.autocrlf true 无济于事。

如何在不擦除项目和创建新存储库的情况下将文件(实际上是多个文件)重新提交到 git/GitHub?

【问题讨论】:

    标签: git github core.autocrlf


    【解决方案1】:

    在我的 Netbeans IDE 环境中,我找到了一个插件来解决这个问题:

    所有问题文件都是“Mac OS 9 (CR)”

    将它们更改为 Unix (LF) 或 Windows (CRLF) -- 然后提交并推送到 GitHub 解决了这个问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-10-15
      • 1970-01-01
      • 2018-12-29
      • 2020-08-29
      • 1970-01-01
      • 2021-01-25
      • 2018-07-08
      • 2020-11-26
      相关资源
      最近更新 更多