[英]How do you use the `git rebase --edit-todo` cmd in interactive rebase when all current to-do's are set to `reword`?
I've ended up not having the time to finish a rebase.我最终没有时间完成 rebase。 The problem is I don't know how to edit my original to-do list because all my current to-do's are
reword
and after each time I finish rewording a commit message it automatically opens the next commit in Vim to be reworded.问题是我不知道如何编辑我的原始待办事项列表,因为我所有当前的待办事项都被
reword
,每次我完成改写提交消息后,它会自动打开 Vim 中的下一个提交进行改写。
If I were editing any of my commits, I could run git rebase --edit-todo
, change the rest of my commit's to pick
, then run git rebase --continue
.如果我正在编辑任何提交,我可以运行
git rebase --edit-todo
,将其余提交更改为pick
,然后运行git rebase --continue
。
Does anybody know if there's a way to edit the to-do's in my case?有人知道在我的情况下是否有办法编辑待办事项吗? Or any other approach?
还是有其他方法?
NOTE: I don't want to abort the rebase and lose all my work.注意:我不想中止 rebase 并丢失我所有的工作。
Try starting another shell instance somewhere, eg, in another window or using :shell
from within vim.尝试在某处启动另一个 shell 实例,例如,在另一个窗口中或在 vim 中使用
:shell
。 Make sure this shell instance is in the correct repository directory ( cd path/to/repo
if necessary) and run git rebase --edit-todo
there.确保此 shell 实例位于正确的存储库目录(
cd path/to/repo
如有必要)并在那里运行git rebase --edit-todo
。 Write out the updated instructions and exit this editor, and then go back to the in-progress rebase.写出更新的指令并退出此编辑器,然后返回进行中的 rebase。 When you finish the current "reword", Git should pick up the edited instructions.
当您完成当前的“改写”后,Git应该会选择编辑过的指令。
I'm concerned that there might be some difference between older versions of Git, in which git rebase -i
is all one big shell script, and newer ones where git rebase -i
uses the C coded sequencer.我担心旧版本的 Git 之间可能存在一些差异,其中
git rebase -i
都是一个大的 shell 脚本,而新版本的git rebase -i
使用 C 编码的音序器。 They are supposed to behave the same way in general, so with luck this works in all Gits, older or newer.它们的行为一般应该是相同的,所以幸运的是,这适用于所有 Git,无论是旧的还是新的。
As my same experience I got same error:正如我的经历一样,我遇到了同样的错误:
error: The following untracked working tree files would be overwritten by merge:
vtysh/vtysh_cmd.db
Please move or remove them before you merge.
Aborting
hint: Could not execute the todo command
hint:
hint: pick 12b0d7cf571a0296fd0e3d64cf254a1d3237d90c resolve discussion
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
Could not apply 12b0d7cf5... resolve discussion
It means I want to do a work (create a file eq. vtysh/vtysh_cmd.db) but it's exist now.这意味着我想做一项工作(创建一个文件 eq. vtysh/vtysh_cmd.db)但它现在已经存在。
solution: remove this file ( rm vtysh/vtysh_cmd.db
) then execute git rebase --continue
解决方案:删除这个文件(
rm vtysh/vtysh_cmd.db
)然后执行git rebase --continue
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.