Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git autocrlf 配置问题 #146

Closed
jimichan opened this Issue Aug 30, 2014 · 6 comments

Comments

Projects
None yet
2 participants
@jimichan
Copy link
Member

jimichan commented Aug 30, 2014

我在osx系统上检出的时候检出的文件,部分有换行符的问题,不知道是我本地设置的问题,还是其他问题。
请问您git的设置,和系统环境是什么,谢谢

一、AutoCRLF

提交时转换为LF,检出时转换为CRLF

git config --global core.autocrlf true

提交时转换为LF,检出时不转换

git config --global core.autocrlf input

提交检出均不转换

git config --global core.autocrlf false

@jimichan

This comment has been minimized.

Copy link
Member Author

jimichan commented Aug 30, 2014

@ansjsun

This comment has been minimized.

Copy link
Member

ansjsun commented Aug 30, 2014

我用的是maxos 和linux 和window。。都可以的。。 git用的默认设置没有设置过其他

@ansjsun

This comment has been minimized.

Copy link
Member

ansjsun commented Aug 30, 2014

我没有做过设置的..在linux 和max checkout应该都问题不大..你哪个原因我真的不知道了.你是要研究源码么?如果不用源码..强烈建议..你继承jar包把

@jimichan

This comment has been minimized.

Copy link
Member Author

jimichan commented Aug 30, 2014

有部分代码使用的\n\r换行的,win环境要配置autocrlf true
我也是osx,使用中需要修改些代码,呵呵

@ansjsun

This comment has been minimized.

Copy link
Member

ansjsun commented Aug 30, 2014

不好意思造成这个问题.有可能是checkout到win机器测试的时候..没注意给提交上来了...

On Aug 30, 2014, at 6:41 PM, jimichan notifications@github.com wrote:

我也是osx,使用中需要修改些代码,呵呵

@jimichan jimichan closed this Aug 30, 2014

@jimichan

This comment has been minimized.

Copy link
Member Author

jimichan commented Aug 30, 2014

呵呵,我在项目里面设置了 core.autocrlf=false 在我本地解决了。
win下还是要提醒其他人注意下的,跨多个平台开发容易导致提交不必要的变更

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.