![](/img/trans.png)
[英]interactive git rebase failed with “git-rebase-todo: No such file or directory”
[英]What would cause an interactive git rebase to fail without modifying the todo?
比方说,我想对具有长期而复杂的合并历史的 repo 的 master 分支进行 rebase。 我想 go 返回大约 100 次提交以提交$SHA
我可以使用git rebase -i $SHA
或git rebase -i $SHA --rebase-merges
来做到这一点。 如果我理解正确,后者包括合并提交,而前者不包括。
无论哪种情况,我都会打开TODO
,然后保存并退出而不更改任何内容。
在这两种情况下,rebase 都会失败。 在--rebase-merges
的情况下,它失败并出现以下错误:
hint: Could not execute the todo command
hint:
hint: label #10:-Merge-dev
hint:
hint: It has been rescheduled; To edit the command before continuing, please
hint: edit the todo list first:
hint:
hint: git rebase --edit-todo
hint: git rebase --continue
在没有该标志的情况下,我的印象是它会“压平” git 历史记录,从而删除合并提交。 但是,这也会导致超过 50 次合并冲突,手动解决这将花费大量时间。
我在这里并不是真的在寻找解决这些问题的方法,我更好奇为什么在 TODO 中几乎没有改变任何内容的同时进行 rebase 会失败。
我相信这是由于您的 label 包含 hash 标记,这很可能被解释为注释。 您可能想要调整 label 及其用途,使其不包含 hash 标记,然后再次尝试变基。
如果这些 TODO 条目是由 Git 创建的,您可能希望将此作为错误报告给 Git 列表; 最近有一些关于无效 label 名称的讨论,您可能需要检查是否有人发送了补丁来修复该问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.