svn更新VS混帐合并(svn update VS git merge)

编程入门 行业动态 更新时间:2024-10-27 03:26:37
svn更新VS混帐合并(svn update VS git merge)

如果两个开发人员修改了相同的文件,svn update命令会自动解决冲突。 如果我在底部附加了一条线,而我的同事在中间插入了一条线。 当我尝试从远程存储库进行更新时,我的更改仍在最新的文件中。

如何在git中处理这个问题? 每次我合并时,由于来自多个开发人员的相同文件的简单更改,我有冲突。

svn update command automatically resolves conflicts if two developers have modified same files. If I appended a line at the bottom while my collegue inserted a line in the middle. When I try to update from remote repository, my change is still at the bottom with updated file.

How this can be handled in git? Everytime I merge, I have conflicts because of simple changes from multiple developers on the same files.

最满意答案

SVN和Git以相同的方式应用传入的更改:应用非重叠更改(本地和远程)而不会发生冲突,重叠更改将产生合并冲突。

这两种工具都可以计算上下文感知的变化块 。 他们不会将文本视为单行。 如果Git中的上下文的宽度大于SVN的上下文(SVN的默认值为3行),那么对于相同的源,您将得到不同的结果。 否则,在Git和SVN中合并应该会得到相同的结果。

SVN and Git apply incoming changes in the same way: non-overlapping changes (local and remote) are applied without conflict, overlapping changes will produce merge-conflicts.

Both tools calculate context-aware chunks of changes. They do not examine text as single-lines. If the width of the context in Git is bigger than that of SVN (default for SVN is 3 lines), you'll get different results for the same sources. Otherwise merging in Git and SVN should give the same results.

更多推荐

本文发布于:2023-08-02 17:45:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1378303.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:混帐   svn   update   merge   git

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!