如果两个开发人员修改了相同的文件,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.
更多推荐
发布评论