jinbao_x头像

关于git提交代码时的LF、CRLF提示的问题

代码提交的时候可能会遇到以下的提示,提示文本中的末尾换行符会进行自动替换,这个是由于windows和linux系统差异导致的,如果想妥善处理这个问题的话,需要修改git配置,可以参照以下配置

17303@ZMsnow MINGW64 /j/githome/yunlanzhiyue (master)
$ commit
warning: in the working copy of '.idea/misc.xml', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of '.idea/yunlanzhiyue.iml', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'README.md', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'manage.py', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'settings/settings.py', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'yunlanzhiyue-mini/project.config.json', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'yunlanzhiyue-mini/project.private.config.json', LF will be replaced by CRLF the next time Git touches it
Please enter submission information:update

17303@ZMsnow MINGW64 /j/githome/yunlanzhiyue (master)
$ git config --global core.autocrlf true

17303@ZMsnow MINGW64 /j/githome/yunlanzhiyue (master)
$ git config --global core.safecrlf true

17303@ZMsnow MINGW64 /j/githome/yunlanzhiyue (master)
$


# 正确配置
git config core.autocrlf input
git config core.safecrlf warn

转载自 CSDN-专业IT技术社区

原文链接:https://blog.csdn.net/qq_42428671/article/details/150866963

文章来源转载

评论

评论列表

微信小程序
QQ小程序

关于作者

点赞数:0
关注数:0
粉丝:0
文章:0
关注标签:0
加入于:--