GIT是否有双重问题? [英] Does GIT have evil twin issues?

查看:114
本文介绍了GIT是否有双重问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在ClearCase中,如果在两个不同版本的目录中找到两个具有相同名称的文件,并且如果元素OID不同,但名称相同,则会发生ClearCase恶意双胞胎。



在GIT中,SHA1 id始终是唯一的,并且具有相同名称的文件始终具有不同的SHA1 ID。



我们没有邪恶双胞胎的概念,但有可能有2个或更多开发人员在同一目录中创建具有相同文件名的不同内容的文件的机会。在合并期间,当两个文件完全不同时,开发人员有机会保留其更改并保留其他更改导致代码丢失。



任何人都可以让我知道如果在GIT中会出现类似于ClearCase或正弦的问题,那么每个SHA1 ID都是唯一的,那么GIT中就不会出现任何Evil孪生问题。

Git确实跟踪整个树的层次,而不是单个文件和目录,所以它没有像OID这样的概念。



合并历史记录(包括不同的内容添加一个新文件),Git将产生合并冲突,并停止让用户解决冲突或中止合并。


$ b $当然,Git不能强迫用户做合并做正确的事情,但也许完全忽略冲突的一方是更困难的。在Git中,冲突将出现在文件本身中,而不是保存文件的目录中。换句话说,冲突将与文件的内容有关,而不是应将哪个OID链接到目录中。当然,根据所使用的工具,用户可能仍然只是按下在所有冲突中站在我的身边,但Git根本不会在意(尽管懒惰的老板和同事可能非常在意!)。 p>

In ClearCase evil twin occurs when two files are found with the same name in two different versions of the directory, and If the element OIDs are different but the names are the same.

In GIT the SHA1 id is always unique and file with same name always have different SHA1 id’s.

We don’t have a concept of Evil twins, but there are likely cases where there is chance for 2 or more developers creating a file with different contents with same filename in the same directory. During merge, when both files are completely different, there are chances of the developers to keep his changes alone and leave other changes resulting in code loss.

Can anyone let me know if there will be issues in GIT similar to ClearCase or sine each SHA1 id is unique there won't be any Evil twin issues in GIT.

解决方案

Git does tracking at the level of the whole tree, not individual files and directories, so it does not have a concept like an OID.

When merging histories that include incompatible changes to a file (e.g. both added a new file with different contents), Git will produce a merge conflict and stop to let the user resolve the conflict or abort the merge.

Of course, Git can not force the user doing the merge do the right thing, but perhaps it is more difficult to completely ignore one side of the conflict. In Git, the conflict will be in the file itself, not in the directory that holds the file. In other words, the conflict will be about the contents of the file instead of which OID should be linked into the directory. Of course, depending on the tool used, the user may still just press the "take my side in all conflicts", but Git will not care in the least (though the lazy lout's boss and coworkers may care very much!).

这篇关于GIT是否有双重问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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