git config --global core.autocrlf truegit config --global core.safecrlf true
由于在不同的操作系统上对同一个项目进行开发,经常遇到因为回车编码不同导致文件明明没有修改却出现在modified files队列中,给Commit造成不便。
虽然diff的时候可以方便的忽略空白,但是提交时仍然不便,这样设置后,提交前就会自动转换(具体见下), Mark 一下。
Git has two modes of how it treats line endings:
$ git config core.autocrlf # that command will print either "true" or "false"
You can set the mode to use by adding an additional parameter of true
or false
to the above command line.
If core.autocrlf
is set to t