根据 Git,谁是“我们”,谁是“他们”?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/21025314/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 09:33:52  来源:igfitidea点击:

Who is "us" and who is "them" according to Git?

git

提问by danza

After a Git rebase, and in other circumstances, you can find some files marked as deleted by usin the git statusreport. Who is usaccording to Git and why?

在Git rebase 之后,以及在其他情况下,您可以在报告中找到一些我们标记为已删除的文件git status。根据 Git,我们是谁,为什么?

Is it referring to me sitting on this branch and it working for me? Or is it referring to itself and the folks working on the branch I am rebasing against?

它是指我坐在这个分支上并对我来说有效吗?或者它指的是它自己和在我所反对的分支上工作的人?

回答by SzG

When you merge, usrefers to the branch you're merging into, as opposed to them, the branch to be merged.

当您合并时us指的是您要合并到的分支,而不是them要合并的分支。

When you rebase, usrefers the upstream branch, and themis the branch you're moving about. It's a bit counter-intuitive in case of a rebase.

当您rebase 时us指的是上游分支,并且them是您要移动的分支。在 rebase 的情况下,这有点违反直觉。

The reason is that Git uses the same merge-engine for rebase, and it's actually cherry-picking your stuff into the upstream branch. us= into, them= from.

原因是 Git 使用相同的合并引擎进行 rebase,它实际上是将你的东西挑选到上游分支中。us= 进入,them= 从。