git - 仍然收到 vscode taskmarks.json 的 git LF 警告
问题描述
虽然我在 git 中执行 LF 将被 CRLF 取代 - 那是什么,它重要吗?
git config core.autocrlf true
我仍然得到
警告:LF 将被替换为 .../.vscode/taskmarks.json 中的 CRLF
如何真正解决这个问题?
解决方案
请参阅“ git 用 CRLF 替换 LF ”:
警告“
LF will be replaced by CRLF
”表示您(拥有autocrlf=true
)将在提交签出周期后丢失您的 unix 风格的 LF(它将被 windows 风格的 CRLF 取代)。
Git 不希望你在 windows 下使用 unix 风格的 LF。
(因此警告)
确保你没有像 .gitattributes 这样的指令* text=auto
。
您可以设置core.safecrlf
为 false,但不能使用 Git 2.17/2.18:请参阅“尝试提交 Git 文件但获取:fatal: LF would be replaced by CRLF
in<some file in repo>
”:您需要 Git 2.19。
推荐阅读
- json - 通过模板将通用 JSON 转换为 XML
- reactjs - 使用 React 从 monorepo 中的另一个包导入 JSX 文件时出错
- sql - WindowsForms-EFCore SQL 异常无效的列名
- c# - 带有 not in 子查询子句的 SQL 查询到 LINQ 查询
- c - scanf 问题:整数输入后跟字符,例如:1p,对于单个输入被视为 2 个输入
- tizen - 如何建立一个表?
- node.js - 为什么 req.logIn() 使用 Angular 时不存储数据?
- php - 将自定义页脚添加到页面模板
- java - 解决groovy模块版本冲突
- angular - 外部包中的 Angular 服务 - 依赖注入 HttpClient 未定义