简体   繁体   English

当所有当前待办事项都设置为“reword”时,如何在交互式 rebase 中使用“git rebase --edit-todo”cmd?

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

相关问题 使用git rebase --edit-todo修复脚本后该怎么办? - What to do after fixing the script with git rebase --edit-todo? 错误:如果没有先前的提交就无法“挤压”您可以使用“git rebase --edit-todo”修复此问题,然后运行“git rebase --continue” - Error: cannot 'squash' without a previous commit You can fix this with 'git rebase --edit-todo' and then run 'git rebase --continue' 如何在git中重命名文件夹并使用交互式rebase隐藏它? - How do you rename a folder in git and hide it with an interactive rebase? git rebase-'edit'和'reword'有什么区别 - git rebase - what's the difference between 'edit' and 'reword' 如何在egg / Emacs中进行交互式git rebase? - How to do an interactive git rebase in egg/Emacs? 如何将Git的交互式rebase与仅限本地的存储库(没有远程/源)一起使用? - How do I use Git's interactive rebase with a local-only repository (no remote / origin)? 交互式 Git 变基完成后,如何运行命令? - How do I run a command when an interactive Git rebase is finished? 你什么时候使用 Git rebase 而不是 Git 合并? - When do you use Git rebase instead of Git merge? Hg:如何像git的rebase那样做一个rebase - Hg: How to do a rebase like git's rebase 在Git的交互式资源库中“选择”是做什么的? - What does “pick” in Git's interactive rebase do?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM