GIT上CSS文件中的持续合并冲突

[英]Continuous merge conflicts in CSS files on GIT


I don't know if that's a common problem. Most of the times that we pull a CSS file from our development repo, GIT conflicts with the current file, entirely merging the two files by putting the ">>>" and "<<<" markers at the very top and bottom, and a "===" marker separating them.

我不知道这是否是一个常见问题。大多数时候我们从开发回购中提取CSS文件,GIT与当前文件冲突,通过在顶部和底部放置“>>>”和“<<<”标记来完全合并这两个文件,将它们分开的“===”标记。

We tried some different indentation, and that helped a little, but there's no success at all. We don't have problems with any other file type, most of them are PHP and JS code, in this case.

我们尝试了一些不同的缩进,这有点帮助,但根本没有成功。在这种情况下,我们没有任何其他文件类型的问题,其中大多数是PHP和JS代码。

If that helps, we have set all the text editors on production to use CRLF.

如果这有帮助,我们已将生产中的所有文本编辑器设置为使用CRLF。

Thanks.

2 个解决方案

#1


5  

This is usually due to an automatic conversion of some kind.

这通常是由于某种类型的自动转换。

Could you try and set config autocrlf to false in all your git (dev and prod)?

您可以尝试在所有git(dev和prod)中将config autocrlf设置为false吗?

That way, no automatic conversion is performed, which helps removing that issue causing potential merge conflicts?

这样,不会执行自动转换,这有助于消除导致潜在合并冲突的问题?

Do you also have some whitespace setting which could introduce some automatic modification?

你是否也有一些空白设置可以引入一些自动修改?


Note: starting git 2.8+ (March 2016), merge markers will no longer introduced mixed line ending (like LF in a CRLF file).
See "Make Git use CRLF on its “<<<<<<< HEAD” merge lines".

注意:启动git 2.8 +(2016年3月),合并标记将不再引入混合行结尾(如CRLF文件中的LF)。请参阅“让Git在其”<<<<<<< HEAD“合并行中使用CRLF”。

#2


3  

The culprit is the CRLF... If some of the boxes are windows, then automatic CRLF conversion will result in those boxes storing the files in "unix" format, even though in your cases, the unix (and mac) boxes are storing them in "dos" format.

罪魁祸首是CRLF ...如果某些方框是窗口,那么自动CRLF转换将导致那些以“unix”格式存储文件的方框,即使在你的情况下,unix(和mac)框也存储它们以“dos”格式。

The solution is to either tell everybody to use "unix" format, which is the typical custom with git projects - and allow windows users to use "dos" format because git (particularly msysgit) will automatically convert by default.

解决方案是告诉每个人使用“unix”格式,这是git项目的典型定制 - 并允许Windows用户使用“dos”格式,因为git(特别是msysgit)将默认自动转换。

Or continue using CRLF (Probably the better idea here), and tell the windows users to STOP using autocrlf or even safecrlf.

或继续使用CRLF(这可能是更好的主意),并告诉Windows用户使用autocrlf甚至safecrlf来停止。


注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:http://www.silva-art.net/blog/2010/11/19/b8c55582bb96f21a302962c787ab14bd.html



 
© 2014-2018 ITdaan.com 粤ICP备14056181号