GitHub:在另一个分支中拉一个分支

时间:2012-08-07 08:03:51

标签: git

我有一个分支(mainbranch),它最近来自master。

如果a git pull origin otherbranch会将分支otherbranch合并到从master派生的mainbranch吗?

可以使用Git merge,但很想知道上述语句会做什么。

我需要的是将otherbranch与主分支合并而且megre正在给出错误

fatal: 'otherbranch' does not point to a commit

1 个答案:

答案 0 :(得分:1)

此命令相当于

git fetch origin otherbranch
git merge FETCH_HEAD

因此:

  1. 从远程otherbranch获取远程分支origin的历史记录(其头部提交暂时保存在FETCH_HEAD中)。
  2. origin/otherbranch(现在位于FETCH_HEAD)的历史记录合并到当前已检出的分支中。
相关问题