Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git: `rebase -i` doesn't work (it doesn't open `.git/rebase-merge/git-rebase-todo`)

Tags:

git

git-rebase

In normal process of git rebase -i would be look like this (=> means terminal command prompt):

=> 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

And rebase -i:

=> git rebase -i 733ca41

It would open .git/rebase-merge/git-rebase-todo via editor:

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

HOWEVER, on my Linux 16.04 LTS, it behaves like this:

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

Nothing opened, nothing happened...

I have no idea what's wrong with this command. Any other git commands work perfectly except rebase -i

Need your helps. Thanks

like image 921
user3595632 Avatar asked Feb 15 '18 04:02

user3595632


People also ask

How do I fix rebasing merge conflicts?

If the change that you submitted has a merge conflict, you need to manually resolve it using git rebase. Rebasing is used to integrate changes from one branch into another to resolve conflicts when multiple commits happen on the same file. Never do a rebase on public (master) branches. You submit a change.


2 Answers

Check if the issue persists with the latest 2.16.x version of Git.

But first, as seen in this answer, check the value of the environment variable GIT_SEQUENCE_EDITOR.
If set to ':', that would make the editor step invisible.

Note: setting the sequence.editor configuration should not have been necessary:

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

So make sure instead that core.editor is set properly, as illustrated in "Associating text editors with Git".

like image 181
VonC Avatar answered Oct 04 '22 05:10

VonC


git config --global sequence.editor vim would work :)

like image 28
user3595632 Avatar answered Oct 04 '22 05:10

user3595632