簡體   English   中英

如何在GIT中提取另一個存儲庫並更新到它的頭部?

[英]How can I pull another repository and update to its head in GIT?

以下是關於Mercurial的問題描述:

鑒於:

  • 兩個倉庫AB ,其中BA的叉子
  • 當前目錄是A尖端的工作目錄。

需要:

  • 拉入B並更新到最新的REV頭。

這就是我要用Mercurial要做的事情:

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

我該如何在GIT中做到這一點? 更具體地說:

我知道這應該是微不足道的,但我仍然無法弄清楚。

任何人?

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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM