git记一次前同事变基中断导致的sourcetree不停弹框

点击sourcetree左上角的提交+号按钮总会弹出提示:


截屏2023-08-22 10.04.59.png

选择放弃变基报错,选择继续变基报错:

error: could not read '.git/rebase-merge/master': No such file or directory

也就是说 git rebase (--continue | --abort | --skip)这三种命令都不起作用,并弹出如上报错。
项目目录输入命令: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)

疑似前同事变基过程中遇到冲突,导致变基中断报错。

运行:

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  [...] -- [...]'

查看不到任何提交记录,怀疑已被撤销或删除。

运行提示的

git rebase --edit-todo
git commit --amend
git rebase --continue

仍然不起作用。

多方查找资料,花了整整半天时间,最后使用

rm -fr ".git/rebase-merge"

将git rebase产生的中间文件删除,解决了问题。

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容