我有一個作業分支 WB,我使用 PR 將其合并到 master。然后我恢復了 master 中的這些更改。
現在,如果我創建一個新的 PR(WB 到 master),我看不到整個更改串列,只能看到最后一次提交的最后更改以及完整的提交串列。
如何查看整個更改串列?
謝謝
uj5u.com熱心網友回復:
你的情況:
WB got merged here (through PR)
| got reverted here (through another PR maybe ?)
| |
v v
*--*---*-----M--*--R--* <- master
\ /
*--*--* <- WB
正如您在上圖中所看到的,git現在認為WB,在其當前狀態下,已經合并到master。
您需要選擇一種方式來創建可以帶回您想要的更改的內容:
*--*---*-----M--*--R--* <- master
\ / \
*--*--* <- WB *--* <- newWB (with changes)
創建此newWB分支的一種方法是“還原還原”:
- 如果還原是在一次提交中完成的:
# create a new branch starting off master :
git checkout -b newWB master
# re-revert the 'R' commit :
git revert R
- 如果還原
R是合并請求的結果,請使用git revert -m xx:
# create a new branch starting off master :
git checkout -b newWB master
# revert the merge commit :
git revert -m 1 R
您現在可以推送該新分支并將其合并到master.
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/355196.html
標籤:混帐
上一篇:GitLabee身份驗證失敗
