我对git还不熟悉,需要一些帮助。我在Windows上使用msysgit。
当我执行命令git add [folderName]
时,我得到以下响应:
fatal: LF would be replaced by CRLF in [.css file or .js file]
然后如果您尝试提交,什么也不会发生。
$ git commit
# On branch master
#
# Initial commit
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# so01/
nothing added to commit but untracked files present (use "git add" to track)
一些 css/js 文件是从网络下载的,所以它们会有 LF。如果我打开该文件并剪切/粘贴内容,则会在下一个文件上出现错误,依此类推。
非常感谢任何帮助。
编辑
将 core.autocrlf
设置为 false 似乎解决了问题,但我在许多帖子中读到不要将该选项设置为 false。
请问有人能指出我在哪里可以找到可能在这种情况下出现的问题?