windows git安装后更换the line ending conversions

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了windows git安装后更换the line ending conversions相关的知识,希望对你有一定的参考价值。

Is there a file or menu that will let me change the settings on how to deal with line endings?

There are 3 options:

  1. Checkout Windows-style, commit Unix-style line endings Git will convert LF to CRLF when checking out text files. When committing text files, CRLF will be converted to LF. For cross-platform projects, this is the recommended setting on Windows ("core.autocrlf" is set to "true")

  2. Checkout as-is, commit Unix-style line endings Git will not perform any conversion when checking out text files. When committing text files, CRLF will be converted to LF. For cross-platform projects this is the recommended setting on Unix ("core.autocrlf" is set to "input").

  3. Checkout as-is, commit as-is Git will not perform any conversions when checking out or committing text files. Choosing this option is not recommended for cross-platform projects ("core.autocrlf" is set to "false")

方法:

The normal way to control this is with git config

For example

git config --global core.autocrlf true

For details, scroll down in this link to Pro Git to the section named "core.autocrlf"


If you want to know what file this is saved in, you can run the command:

git config --global --edit


以上是关于windows git安装后更换the line ending conversions的主要内容,如果未能解决你的问题,请参考以下文章

git上传代码报错-The file will have its original line endings in your working directory

[git] -- warning: LF will be replaced by CRLF in app/app.iml. The file will have its original line e

Bower : ENOGIT git is not installed or not in the PATH

git出现“The file will have its original line endings in your working directory”错误

Windows安装Git环境及使用

[转]How do I run msbuild from the command line using Windows SDK 7.1?