Git: `rebase -i` 不工作(它不打开 `.git/rebase-merge/git-rebase-todo` )

标签 git git-rebase

git rebase -i 的正常过程中看起来像这样(=> 表示终端命令提示符):

=> git logg
* 7bec976 (HEAD -> develop, origin/develop) Update JANDI task: add Bitcoin topic
* e03aecc Update production.txt:remove pandas and set celery-beat version
* baaaf4b Update JANDI task: Fix link bug
* bb422af Update Procfile: on flower
* 733ca41 Implement JANDI task

rebase -i:

=> git rebase -i 733ca41

它将通过编辑器打开 .git/rebase-merge/git-rebase-todo:

1 pick bb422af Update Procfile: on flower
2 pick baaaf4b Update JANDI task: Fix link bug
3 pick e03aecc Update production.txt:remove pandas and set celery-beat version
4 pick 7bec976 Update JANDI task: add Bitcoin topic
5
6 # Rebase 733ca41..7bec976 onto 733ca41 (4 commands)
7 #
8 # Commands:
9 # p, pick = use commit
10 # r, reword = use commit, but edit the commit message
11 # e, edit = use commit, but stop for amending
12 # s, squash = use commit, but meld into previous commit
13 # f, fixup = like "squash", but discard this commit's log message
14 # x, exec = run command (the rest of the line) using shell
15 # d, drop = remove commit
16 #
17 # These lines can be re-ordered; they are executed from top to bottom.
18 #
19 # If you remove a line here THAT COMMIT WILL BE LOST.
20 #
21 # However, if you remove everything, the rebase will be aborted.
22 #
23 # Note that empty commits are commented out

但是,在我的 Linux 16.04 LTS 上,它的行为如下:

=> git rebase -i 733ca41
Successfully rebased and updated refs/heads/develop.
=>

没有打开,没有任何反应......

我不知道这个命令有什么问题。除了 rebase -i

之外,任何其他 git 命令都可以完美运行

需要您的帮助。谢谢

最佳答案

使用最新的 2.16.x 版本的 Git 检查问题是否仍然存在。

但首先,作为seen in this answer ,检查环境变量GIT_SEQUENCE_EDITOR的值。
如果设置为“:”,这将使编辑器步骤不可见。

注意:设置sequence.editor configuration不应该是必要的:

When not configured the default commit message editor is used instead.

因此请确保 core.editor设置正确,如“Associating text editors with Git”所示。

关于Git: `rebase -i` 不工作(它不打开 `.git/rebase-merge/git-rebase-todo` ),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48799947/

相关文章:

git - 正在进行中。无法提交。如何进行或停止(abort)?

git - 如何按文件拆分每个提交?

git - 在 Pull 请求后 rebase

git log,仅提交发生在分支预 merge 上的提交

git rm undo 对于未添加的文件

git - 将修改后的文件指定为 git diff 参数的快捷方式

git - 运行 jenkins 作业的 Bitbucket webhook

git - 我可以在 Ubuntu 中设置终端来告诉我我在哪个分支吗?

git - 如何使用 git rebase 压缩 merge 周围的提交?

git - merge 分支的交互式 Rebase