我该如何提取另一个存储库并在git中更新到其头部



以下是问题的描述:

给定:

  • 两个回购 a b ,其中 b a a
  • 的叉子
  • 当前目录是 a 的尖端的工作目录。

需要:

  • 拉动 b ,然后更新到其最新的头 REV

这是我想在Mercurial任职的事情:

A> hg pull B
A> hg heads         # Notice the most recent head of B
A> hg update **REV**

我该如何在git中进行?更具体地:

  • a 是https://github.com/yui/yui3-gallery.git
  • 的主分支
  • b 是https://github.com/jafl/yui3-gallery.git
  • 的主分支
  • 我需要更新到 b 的最新修订版,当我有一个本地克隆 a

我知道这应该很微不足道,但我仍然无法弄清楚。

有人吗?

git remote add other_repo
git fetch
git merge other_repo/branch
git remote add a_repo a_repo_url
git fetch a_repo
git merge a_repo/branch

最新更新