当前位置:   article > 正文

git commit遇到的问题:The file will have its original line ...(亲测可用)_the file will have its original line endings in yo

the file will have its original line endings in your working directory warni

遇到问题:

The file will have its original line endings in your working directory.

warning: CRLF will be replaced by LF in src/Presentation.Seedwork/Resources/Mess
ages.Designer.cs.

The file will have its original line endings in your working directory.


分析问题:系统换行符不同导致,git是linux规范。

    Window下的命令换行符是\r\n;
    Linux 下的命令换行符是\n;

    Git 本身采用的规范是linux规范,也就是说文件在存储的时候,会有一些转换,一旦文件中有一些\r\n符号的话,它都会帮你换成\n。


解决方案:

运行git命令: 
  1. git config core.filemode false
  2. git config core.eol lf

原理是:给你本地的repo设置一下。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Gausst松鼠会/article/detail/572075
推荐阅读
相关标签
  

闽ICP备14008679号