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