所以我最近才開始使用更多的 git 功能,但我有點迷茫。
我從
master分支克隆了回購。做了一些編碼。
git checkeout -b newbranch然后我git commit和git push origin newbranch我確實在 bitbucket 中拉取請求,但它指向
master分支,我被告知將它指向develop分支,所以我做到了。然后我得到:
所以在我的終端中我做了
git checkout develop但是當我嘗試時git pull我收到了Already up to date訊息。因此,如果develop分支不同于newbranch并且導致沖突,為什么我不能拉它?我在這里不明白什么?
我需要從develop分支獲取代碼,解決沖突,然后再次推送并再次執行拉取請求。
uj5u.com熱心網友回復:
您需要解決的沖突在develop和之間newbranch。
從本地存盤庫解決此問題的兩種主要方法是:
- 重新建立
newbranch在develop
# from branch 'newbranch' :
git checkout newbranch
# rebase on top of 'develop' :
git rebase develop
# if you actually need to edit or drop commits along the way, you may use
# an interactive rebase :
git rebase -i develop
- 合并
develop成newbranch
# from branch 'newbranch' :
git checkout newbranch
# merge 'develop' :
git merge develop
選擇適合您作業流程的任何方式。
您需要修復沖突以完成這些操作中的任何一個——您的遙控器說有一些。
一旦您newbranch對本地存盤庫上的更新感到滿意,請將其推送到您的遠程:
git push origin newbranch
# if you ran rebase, you will need to force push your branch :
git push --force-with-lease origin newbranch
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/313231.html
