點(diǎn)擊sourcetree左上角的提交+號(hào)按鈕總會(huì)彈出提示:

截屏2023-08-22 10.04.59.png
選擇放棄變基報(bào)錯(cuò),選擇繼續(xù)變基報(bào)錯(cuò):
error: could not read '.git/rebase-merge/master': No such file or directory
也就是說(shuō) git rebase (--continue | --abort | --skip)這三種命令都不起作用,并彈出如上報(bào)錯(cuò)。
項(xiàng)目目錄輸入命令:git status
Last command done (1 command done):
pick 226b8bf 支付路由完善+
Next commands to do (1 remaining commands):
pick 534c24a 支付路由+完善
(use "git rebase --edit-todo" to view and edit)
You are currently editing a commit while rebasing branch 'master' on '9337780'.
(use "git commit --amend" tp amend the current commit)
(use "git rebase --continue" once you are satisfied with your changes)
疑似前同事變基過(guò)程中遇到?jīng)_突,導(dǎo)致變基中斷報(bào)錯(cuò)。
運(yùn)行:
git show 226b8bf
git show 534c24a
提示如下:
fatal: ambiguous argument '83516cb': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git [...] -- [...]'
查看不到任何提交記錄,懷疑已被撤銷(xiāo)或刪除。
運(yùn)行提示的
git rebase --edit-todo
git commit --amend
git rebase --continue
仍然不起作用。
多方查找資料,花了整整半天時(shí)間,最后使用
rm -fr ".git/rebase-merge"
將git rebase產(chǎn)生的中間文件刪除,解決了問(wèn)題。