Git(GitHub):多平台开发和autocrlf选项? [英] Git (GitHub): Multiplatform development and autocrlf option?

查看:139
本文介绍了Git(GitHub):多平台开发和autocrlf选项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有点困惑,目前我正在使用GIT,并且所有的都在我的Windows PC上。我有我的autocrlf设置为true,根据这是正确的

https://help.github.com/articles/dealing-with-line-endings



其实我有没有抱怨似乎工作得很好,有一些警告一次又一次,但我通常忽略它们。



但是,这实际上是做什么呢?这是否在添加PULL时添加CR / LF,然后在推送时将CRLF更改为LF?



因此,在回购中的ALWAYS有文件带有ONLYLF而不是CRLF?

即将开始在与Mac OS X和Linux相同的存储库中进行开发,现在这是我感到困惑的地方,根据GITHUB它指出,对于Windows将Autocrlf设置为TRUE ...



但在Linux / MAC OS X上...我也这样做吗?



Linux我知道不会使用CRLF



非常感谢您的帮助。



谢谢

谢谢每个人都有评论



我看到关于stackoverflow的各种评论,并没有将它用作true,但我当然使用3种类型的系统,所以我想这个为什么在这里推荐?

并且推荐linux?但它永远不会使crlf。



所以我想情况是,总是把它保留为真 - 以防万一?

解决方案

这可能有助于回答您的一些问题。



基本上,如果您使用的编辑器无法正确处理换行符,一个抱怨很多(如Visual Studio)。

I am a little confused, I am currently using GIT and all is well on my windows pc. I have my autocrlf set to true which according to this is correct

https://help.github.com/articles/dealing-with-line-endings

Actually i have no complaints it seems to work very well, there are some warning now and again but i normally ignore them.

But what does this actually do then? Does this add CR/LF when doing a PULL and then change CRLF to LF when doing a push?

So "ALWAYS" in the repo there are files with "ONLY" LF and not CRLF?

I am about to start development in the same repository with a MAC OS X and linux, now this is where i get confused, according to GITHUB it states that for windows set Autocrlf to TRUE ...

But on Linux / MAC OS X... do i do the same?

Linux i know doesn't use the CRLF

ANy help really appreciated.

Thanks

Thanks everyone for there comments

I see various comments on stackoverflow to not use it as true, but of course i am using 3 types of systems so i suppose this is why its recommended here?

And linux is recommended too? but it would never make crlf.

So i suppose the case is, always leave it as true - just in case?

解决方案

This might help answer some of your questions.

Basically, this only really matters if you're using an editor that cannot deal with line endings properly, or one that complains a lot (like Visual Studio).

这篇关于Git(GitHub):多平台开发和autocrlf选项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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