论据merge
已解析为提交 ID。这意味着规则中git 修订版被应用。一般来说,origin/name
解析为“远程分支”之一git fetch
and git push
保持每次获取和推送的最新状态。
“远程分支”,也称为“远程跟踪分支”,只是一个类似分支的标签,其“全名”以refs/remotes/
。远程名称的所有名称origin
are in refs/remotes/origin/
。正常运行时git fetch
咨询一些远程(例如origin
) git 存储库并询问它:“嘿,你那里有哪些分支,它们的 SHA-1 值是多少?”当它得到答案时,它将它们存储在本地yourgit 存储库:refs/remotes/origin/master
, refs/remotes/origin/devel
, 等等。这样你就可以知道你的 git 上次有机会同步时“那边”的情况是什么样的。
这些不应与 git 所谓的“跟踪分支”(或“本地跟踪分支”)混淆。本地分支机构是“全名”开头的标签refs/heads/
。如果它们具有与其相关的“上游”信息,则它们被视为“跟踪”。您可以在第一次创建分支时放入上游信息 - 这通常是与远程分支具有“相同”名称的本地分支的情况,例如master
vs origin/master
—或者您可以稍后设置(或更改)它git branch --set-upstream-to.
All of these are different from the git pull
syntax: git pull origin master
is rather different, and much older, predating the whole idea of "remote-tracking branches" entirely.1 This sort of accidental resemblance, as it were, I think is the source of a whole lot of confusion (I know I found it confusing, years ago).
1Specifically, you used to (and still can) git pull
from a URL rather than a "remote" name. That went (and still goes) over to the other git repository as usual, and gets a list of at least some of its branches (sometimes just the one of interest). But, because those are its branches, not yours, they are then recorded in a file called FETCH_HEAD
. So at this point, it will have brought master
over from "over there", but put it into FETCH_HEAD
rather than a remote-tracking branch—with a raw URL, you don't have a remote name, so there's no way to name the remote-tracking branch: there's no origin
with which to construct the prefix refs/remotes/origin
. The master
argument to git-pull
then means: "go search through FETCH_HEAD
to find their master
branch."