gpt4 book ai didi

svn - SVN 和 Git merge 有什么区别?

转载 作者:IT王子 更新时间:2023-10-29 01:10:26 45 4
gpt4 key购买 nike

正如标题所暗示的,我很好奇为什么有这么多人吹捧 Git 作为分支/merge SVN 的更好选择。我很好奇,因为 SVN merge 很糟糕,我想要一个替代解决方案。

Git 如何更好地处理 merge ?它是如何工作的?

例如,在 SVN 中,如果我有以下行:

世界,您好!

然后 user1 将其更改为:

你好,世界!1

然后 user2 将其更改为:

Hello World !12

然后user2提交,然后user1提交,SVN会给你一个冲突。 Git 可以解决像这样简单的问题吗?

最佳答案

那是在 merge 冲突时调用的,没有VCS将永远为您解决。
您将必须自己手动解决 merge 问题。

Why merging in git is better than SVN 中所述,实际的区别在于提交的历史记录:

这允许 Git 记住已经 merge 的内容,从而大大减少冲突的发生。

DAG

So, when it comes time to do merge from 5b over to the (a) branch, we can use information in the DAG to know that 3b and 2b are already done


所以它是 merge workflow Git 将比 SVN 更优雅地处理:
参见 Merge Git vs. SVN具体例子。

关于svn - SVN 和 Git merge 有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2692950/

45 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com