当你使用Linux和Windows时,什么是最好的git配置? [英] What is the best git config set up when you are using Linux and Windows?

查看:148
本文介绍了当你使用Linux和Windows时,什么是最好的git配置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



http://git-scm.com/docs/git-config



我使用的是Ubuntu和Widows。



我有^ M以及其他问题。



任何人都可以推荐这个问题的最佳git配置设置?



预先感谢。

解决方案

详细介绍 Git在Windows(msysgit) - Unix或DOS行终止,我会用:

  git config --system core.autocrlf false 

这将避免任何自动eol转换(请参阅 Git在Windows上:什么crlf的设置是什么意思?这个选项值的确切含义)。

您可以将其保留为true,如 git用CRLF替换LF ,但我更喜欢设置 core.eol +某些 gitattribute 文件,以便微调我想要更改的一些文件。

请参阅这个答案以获取更多详情。


I am a bit confused with core.eol, core.autocrlf, core.safecrlf for git config.

http://git-scm.com/docs/git-config

I am using Ubuntu and Widows.

I had ^M, and other issues before.

Could anyone suggest the best git config setups for this problem?

Thanks in advance.

解决方案

As detailled in Git on Windows (msysgit) - Unix or DOS line termination, I would use:

git config --system core.autocrlf false

That would avoid any automatic eol transformation (See "Git on Windows: What do the crlf settings mean?" for the exact meaning of this option value).

You can leave it to true, as explained in git replacing LF with CRLF, but I prefer setting core.eol + some gitattribute files in order to fine tune some of the files I want eol changes on.
See this answer for more details.

这篇关于当你使用Linux和Windows时,什么是最好的git配置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆