Windows上的Git 1.6.4 beta(msysgit) - Unix或DOS行终止 [英] Git 1.6.4 beta on Windows (msysgit) - Unix or DOS line termination

查看:104
本文介绍了Windows上的Git 1.6.4 beta(msysgit) - Unix或DOS行终止的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的Win Vista开发VPC上安装msysgit 1.6.4测试版。安装屏幕正在请求我是否要使用Unix行终止或DOS行终止。通常,我会选择DOS,但设置文本表明DOS终止可能意味着文件不能与所有Git的命令行工具一起使用。 Unix线路终端指出:......大多数[Windows]应用程序都可以处理这个...。

有谁知道我应该选择通过shell为我的VS 2008工作?

解决方案

msysgit安装过程中的设置实际上是为了修复 core.autocrlf 配置

  core.autocrlf 




如果为true,则使文本文件中行尾的 CRLF 转换为 LF 从文件系统读取时,并在写入文件系统时反向转换。



变量可以设置为'输入',在这种情况下,转换仅在从文件系统读取时发生,但文件在行的末尾用 LF 写出。



目前,考虑文本(即受到autocrlf机制)的路径完全取决于内容。


我会坚持让不是尝试自动转换任何东西,副作用太重要了(就潜在的合并冲突而言,尤其是分布式开发与不同的环境)

如果您的工具可以处理Unix风格的行终止,您应该将它们设置为生成Unix行,然后可以通过Windows读取(VS2008 ,Notepad ++等)和Unix一样,并且可以由任何'sh'Git脚本处理。



但是,如果将 core.autocrlf 设置为false,则转换文本行终止的决定将是自愿显式一个,而不是背景无形的副作用。






更多信息请参见在不同操作系统下< git core.autocrlf 如何处理结束转换

 
|在|时产生转换在
|时产生转换用各种|提交文件签出FROM回购 -
| EOLs INTO回购和|混合文件和
| core.autocrlf值:| core.autocrlf值:
----------------------------------------- ---------------------------------------
文件| true |输入| false | true |输入| false
--------------------------------------------- -----------------------------------
Windows-CRLF | CRLF - > LF | CRLF - > LF |按原样|按原样|按原样|原样是
Unix -LF |按原样|按原样|按原样| LF - > CRLF |按原样|原样是
Mac -CR |按原样|按原样|按原样|按原样|按原样|原样是
Mixed-CRLF + LF |按原样|按原样|按原样|按原样|按原样|原样是
Mixed-CRLF + LF + CR |按原样|按原样|按原样|按原样|按原样|原样是


I am installing msysgit 1.6.4 beta on my Win Vista development VPC. An install screen is requesting whether I want to use Unix line termination or DOS line termination. Ordinarily, I'd choose DOS, but the setup text indicates that DOS termination may mean files do not work with all of Git's command line tools. The Unix line termination states "...most [Windows] applications can handle this...".

Does anyone know which option I should choose to use Git via the shell for my VS 2008 work?

解决方案

That settings during the install process of msysgit is actually here to fix the value of the core.autocrlf config.

core.autocrlf

If true, makes git convert CRLF at the end of lines in text files to LF when reading from the filesystem, and convert in reverse when writing to the filesystem.

The variable can be set to 'input', in which case the conversion happens only while reading from the filesystem but files are written out with LF at the end of lines.

Currently, which paths to consider "text" (i.e. be subjected to the autocrlf mechanism) is decided purely based on the contents.

I would insist on not trying to convert anything automagically, the side-effects are just too important (in term of potential merging conflict, especially on distributed development with different environments)

If your tools can handle Unix-style line termination, you should set them to produce Unix lines, which can then be read by Windows (VS2008, Notepad++, ...) and Unix alike, and can be processed by any 'sh' Git-scripts.

But with core.autocrlf set to false, the decision to transform a text line termination will be a voluntary explicit one, not a background invisible side-effect one.


See more at "How line ending conversions work with git core.autocrlf between different operating systems"

                 | Resulting conversion when       | Resulting conversion when 
                 | committing files with various   | checking out FROM repo - 
                 | EOLs INTO repo and              | with mixed files in it and
                 |  core.autocrlf value:           | core.autocrlf value:           
--------------------------------------------------------------------------------
File             | true       | input      | false | true       | input | false
--------------------------------------------------------------------------------
Windows-CRLF     | CRLF -> LF | CRLF -> LF | as-is | as-is      | as-is | as-is
Unix -LF         | as-is      | as-is      | as-is | LF -> CRLF | as-is | as-is
Mac  -CR         | as-is      | as-is      | as-is | as-is      | as-is | as-is
Mixed-CRLF+LF    | as-is      | as-is      | as-is | as-is      | as-is | as-is
Mixed-CRLF+LF+CR | as-is      | as-is      | as-is | as-is      | as-is | as-is

这篇关于Windows上的Git 1.6.4 beta(msysgit) - Unix或DOS行终止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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