首页 前端知识 报错-warning: in the working copy of ‘xxx.vue‘, LF will be replaced by CRLF the next time Git touc

报错-warning: in the working copy of ‘xxx.vue‘, LF will be replaced by CRLF the next time Git touc

2024-06-26 23:06:29 前端知识 前端哥 689 490 我要收藏

问题:在进行 git add时,出现 报错:warning: in the working copy of 'src/xxx.vue', LF will be replaced by CRLF the next time Git touches it

翻译:警告:在 'src/xxx.vue' 的工作副本中,下次 Git 遇到 LF 时,LF 将被 CRLF 替换。

知识点:

CR为回车符,LF为换行符。Windows结束一行用CRLF,Mac和Linux用LF。

core.autocrlf

false表示取消自动转换功能 -> 适合纯Windows

true表示提交代码时 把CRLF转换成LF,检出时LF转换成CRLF -> 适合多平台协作

input 表示提交时 把CRLF转换成LF,检出时不转换 -> 适合纯Linux或Mac

解决:因为博主使用的是 Windows,需要设置 git config --global core.autocrlf true

参考:

git如何避免”warning: LF will be replaced by CRLF“提示? - 知乎 (zhihu.com)

git提示“warning: LF will be replaced by CRLF”的解决办法_青崖林夕的博客-CSDN博客

Git - 配置 Git (git-scm.com)相关知识点:

转载请注明出处或者链接地址:https://www.qianduange.cn//article/13647.html
标签
git
评论
发布的文章

Markdown基础与进阶语法

2024-06-30 22:06:12

零基础 HTML 入门(详细)

2024-06-30 22:06:09

CSS3基本语法

2024-06-30 22:06:51

大家推荐的文章
会员中心 联系我 留言建议 回顶部
复制成功!