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的回车符 #9

Open
felix9ia opened this issue May 12, 2019 · 0 comments
Open

关于git的回车符 #9

felix9ia opened this issue May 12, 2019 · 0 comments
Labels
工作技巧 关于工作中遇到的踩过的坑和相应经验

Comments

@felix9ia
Copy link
Owner

cssmagic/blog#22

git config --global core.autocrlf false

git config --global core.safecrlf true
core.autocrlf=false
core.safecrlf=true

在用户的根目录下的gitconfig文件中

增加配置文件 .gitattributes
虽然通过设置了 git 全局参数解决了问题,但是作为团队协作的话,并不能保证所有人都正确配好了。git 提供了.gitattributes文件解决了这个问题。在项目根目录新建.gitattributes文件,添加一下内容:

Set the default behavior, in case people don't have core.autocrlf set.
text eol=lf

@felix9ia felix9ia added the 工作技巧 关于工作中遇到的踩过的坑和相应经验 label Jul 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
工作技巧 关于工作中遇到的踩过的坑和相应经验
Projects
None yet
Development

No branches or pull requests

1 participant