- 我有一個開發分支和一個名為 init-work的功能分支。
- 我將我的更改推送到 gitlab
- 在我發出拉取請求之前,我不小心將我的 init-work 合并到 develop 中。
- 所以現在我需要從開發中取消合并我的初始化作業。
我該怎么做?
這就是我的想法:我想做git push -f feature/init-work no 嗎?
uj5u.com熱心網友回復:
假設這是一個多用戶專案,最好將其還原,然后重新設定功能分支的基線,以便 git認為它根本沒有合并。
git checkout develop
git revert HEAD # given that it is the last commit in the branch
git push origin develop # push it into the remote
git checkout feature/init-work
git commit --amend --no-edit # create a brand new revision separate from the one that was merged/reverted in develop
# now it can be rebased on top of develop
git rebase develop
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/537653.html
標籤:混帐知乎GitLab
