2016-02-28 48 views
1

在git中,你如何將變化合併到你在一個單獨的fork中製作的repo的fork中?如何合併來自兄弟分岔的git pull請求?

例如,假設我已將git repo A分配到本地回購B.後來有人強制回購A回到其回購C並創建了回購答的請求A.如何將該請求合併到我的回購B ?

回答

3

合併請求不是Git功能,但特定於存儲庫託管提供程序,如GitHub。合併請求通常不可轉讓/可複製(不適用於GitHub)。

你可以做的是合併Pull請求的底層分支。合併請求從someremote/somebranchotherremote/otherbranch。如果您知道someremote/somebranch,則可以在本地Git庫中添加遠程設備,併合並someremote/somebranch

因此,在您的示例中,您可以添加遠程服務器回購B,將提取請求中從repoB/somebranch開始的分支合併到repoA/master。事情是這樣的:

git remote add repoB url_to_repo_B 
git fetch repoB somebranch 
git merge repoB/somebranch 
+0

上合併PR有趣的閱讀:https://ericjmritz.name/2015/06/22/why-and-how-i-avoid-githubs-merge-pull-request-feature/ – VonC