GIT在提交或签出(vi)期间是否进行CRLF/LF转换? [英] Does GIT does the CRLF/LF conversion during commit or checkout(vi)?

查看:165
本文介绍了GIT在提交或签出(vi)期间是否进行CRLF/LF转换?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在有一个疑问,在提交或文件的vi期间,Git会进行CRLF转换吗?

I have a doubt now, does Git does the CRLF conversion during a commit or during a vi of the file?

假设我在Windows中有一些带有CRLF的文件(不是Git存储库),当我将这些文件同步到UNIX Git存储库并在启用autocrlf true的情况下进行git add/commit时,这些文件会从CRLF中获得转换吗?到LF?

Let’s say I have some files in Windows with CRLF (not a Git repo), when I sync these files to a UNIX Git repo and do git add/commit with autocrlf true enabled, will these files get the conversion from CRLF to LF?

还是仅当我vi这些文件并再次提交时才进行这些文件的转换?

Or does it do the conversion of these files only when I vi these files and commit it again?

第二个疑问是,如果我的父存储库存在于Unix中并且仅需要LF,则Unix和Windows Git克隆中的autocrlfsafecrlf设置应该是什么.我应该使用全局设置吗?

The second doubt is, what should be the autocrlf and safecrlf setting in both Unix and Windows Git clones if my parent repository exists in Unix and need LF alone. Should I use global setting?

预先感谢

推荐答案

svn:eol-style(就像core.autocrl f 一样)是一种在结帐和提交时发生的机制.

关于该设置的值,在两面(Windows/Unix)上,全局设置),如 jleedev 对您的问题的评论.
相同于safecrl .

As for the value of that setting, on both sides (Windows/Unix), I always set it to false (in a global setting), as jleedev comments on your question.
Same for safecrl.

这篇关于GIT在提交或签出(vi)期间是否进行CRLF/LF转换?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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