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

use*_*632 5 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
Run Code Online (Sandbox Code Playgroud)

并且rebase -i

=> git rebase -i 733ca41
Run Code Online (Sandbox Code Playgroud)

它将.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
Run Code Online (Sandbox Code Playgroud)

但是,在 my 上Linux 16.04 LTS,它的行为是这样的:

=> git rebase -i 733ca41
Successfully rebased and updated refs/heads/develop.
=>
Run Code Online (Sandbox Code Playgroud)

什么都没打开,什么都没发生……

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

需要你的帮助。谢谢

Von*_*onC 4

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

但首先,如本答案所示,检查环境变量的值GIT_SEQUENCE_EDITOR
如果设置为“ :”,则编辑器步骤将不可见。

注意:设置sequence.editor配置不是必需的:

如果未配置,则使用默认提交消息编辑器。

因此,请确保core.editor设置正确,如“将文本编辑器与 Git 关联”中所示。