各位好
本人在近來在公司需要將專案中某個pull request的commit統合成一個
下圖為pull request,本公司用的是bitbucket
https://ibb.co/6gWQPnf
我看了一些網路教學和youtube,仍然想不出解法。我的做法如下:
先在local的branch中執行git rebase -i HEAD~5
在interactive mode中將之前5個commits壓成一個
https://ibb.co/VDqvhxv
有時會執行完後會出現conflict。將conflict resolve後使用以下指令push到remote
git push <local_branch>:<remote_name> -f
然而,push 之後,不僅失敗,我看到的還是pull request被decline:
如果我要re-open這pull request,則會出現以下error:
https://ibb.co/sV8P4dW
我的mentor是和我說,如果bitbucket的pull request出現大變動時,會自動decline
必須要重新push最新的commit才能解開
請問版上有沒有大神能指點我如何合併bitbucket中遠端pull request的commit?
問題描述不清楚的地方我會再補充,謝謝!