谁是“我们”?谁是“他们”?根据Git? [英] Who is "us" and who is "them" according to Git?

查看:141
本文介绍了谁是“我们”?谁是“他们”?根据Git?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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



它是指我坐在这个分支上,它为我工作吗?或者它指的是自己以及在分支上工作的人员,我正在重新设计?

解决方案

merge us 引用您正在合并的分支,而不是它们,要分支的分支合并。



当您 时,我们指向上游分支,他们是你正在移动的分支。对于rebase而言,这有点违反直觉。



原因是Git使用相同的合并引擎进行rebase,而且它实际上是将你的东西挑选上游分支。 我们 =进,他们 = from。


After a Git rebase, and in other circumstances, you can find some files marked as deleted by us in the git status report. Who is us according to Git and why?

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?

解决方案

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

When you rebase, us refers the upstream branch, and them is the branch you're moving about. It's a bit counter-intuitive in case of a 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?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆