我是 Git 新手。我 fork 了一个存储库,创建了一个分支,做了一些更改,提交了,然后当我推送(git push origin master)时,出现以下错误:
Starting Pattern Checks
.gitattributes --> Please make sure all files only have LF endings (no CRLF).
core/templates/dev/head/dashboard/notifications_dashboard.html --> Please use spaces instead of tabs.
(41 files checked, 2 errors found)
FAILED Pattern checks failed
Push failed, please correct the linting issues above
我正在 Windows 7 上运行 git。有人可以帮助我吗?谢谢。
更新:“请使用空格而不是制表符。”通过在 Notepad++ 的“编辑->空白操作->TAB 到空格”中将 TAB 转换为空格来纠正错误。
最佳答案
该错误意味着该项目需要 Unix 风格的行结尾 (LF)。但是,您正在使用 Windows 样式的行结束符 (CRLF)。所有不错的编程文本编辑器和 IDE 都有一个选项来设置它。编辑人员还可以选择仅用 LF 快速替换所有 CRLF 序列。您需要了解如何在您的系统中执行此操作。
我还建议您了解 git 中的分支。如果您正在为更大的项目做出贡献,则需要为您想要进行的每组相关更改创建一个新分支。直接向 master
提交是非常不受欢迎的。
关于git - 推送到 GitHub 存储库时出现 "Please make sure all files only have LF endings"错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39024762/