1
我一直試圖用另一個分支替換回購的master
分支,但是我嘗試的每種方式都保留了不在其他分支中的提交。例如,另一個分支有121個提交,但在命令之後(兩個集都在下面)主顯示216個提交!如何完全替換master和其他所有提交的提交?
嘗試#1
#Replacing master with otherBranch branch
git checkout otherBranch
git merge -s ours master
git checkout master
git merge otherBranch
git push
嘗試#2
git checkout otherBranch
git push [email protected]:remoteRepo :master
#Also tried
git checkout otherBranch
git push [email protected]:remoteRepo +otherBranch:master
的這些都具有相同的結果結束。
那麼我如何完全取代其他分支的主人?