英文:
git merge: Does it matter which commit is newer?
问题
无论A或B是更近的提交,合并B到A都会得到相同的结果,与时间戳无关。
英文:
Suppose I have two commmits, A and B. Suppose I am merging B into A. Does it matter whether A or B is the more recent commit? Or will I get the same result independent of the timestamps?
答案1
得分: 2
在时间戳独立的情况下,我会得到相同的结果吗?
是的。合并是通过同时在两边执行自从两边分歧点以来的“更改”来完成的。两边的权重完全相同。它不管它们在时间上如何关联或哪一边合并到哪一边。
然而,一个常见的困惑源是没有意识到一边没有变化意味着没有贡献。如果分歧点有Hey,而其中一边现在有Ho,另一边有Hey,合并的结果将是Ho。
英文:
> will I get the same result independent of the timestamps?
Yes. A merge is performed by enacting simultaneously the "changes" on both sides since the point where the sides diverged. Both sides weigh 100% equally. It doesn't matter how they relate temporally or which side is being merged into which.
A common source of confusion, though, is failure to realize that lack of change on one side means no contribution. If the divergence point has Hey, and if one side now has Ho and the other side has Hey, the result of the merge will be Ho.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论