What is the best git config set up when you are using Linux and Windows?

一个人想着一个人 提交于 2019-12-30 06:49:47

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/6081607/what-is-the-best-git-config-set-up-when-you-are-using-linux-and-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!