Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

interactive git rebase failed with "git-rebase-todo: No such file or directory"

Tags:

git

rebase

cygwin

when I do interactive git-rebase:

git rebase -i HEAD~2

it shows:

C:\GnuWin32\bin\grep.exe: /cygdrive/xxx/.git/rebase-merge/git-rebase-todo: No such file or directory Nothing to do

(xxx is the project path)

but git rebase branch_xxx is working.

I am sure no rebase is in progress previous(checking with git rebase --abort and use clean project folder both)

have some one solved this ? I google it but wihtout useful tips.

like image 684
guozhu cheng Avatar asked Jun 17 '13 04:06

guozhu cheng


People also ask

How do I stop git rebase?

You can run git rebase --abort to completely undo the rebase. Git will return you to your branch's state as it was before git rebase was called. You can run git rebase --skip to completely skip the commit.

What rebase means?

Rebasing is the process of moving or combining a sequence of commits to a new base commit. Rebasing is most useful and easily visualized in the context of a feature branching workflow.

What does git rebase -- skip do?

You can run git rebase --skip to completely skip the commit. That means that none of the changes introduced by the problematic commit will be included. It is very rare that you would choose this option.

Why you should rebase instead of merge?

But, instead of using a merge commit, rebasing re-writes the project history by creating brand new commits for each commit in the original branch. The major benefit of rebasing is that you get a much cleaner project history. First, it eliminates the unnecessary merge commits required by git merge .


2 Answers

My problem was due to my gitconfig missing the -w and -n flags:

[core]
    editor = sublime -w -n

From Code Project:

[The -w and -n arguments are] passed to Sublime Text, and essentially tell it to run without loading any previously open windows (the –n flag), and to wait until the user exits to pass execution back to the calling process (the –w flag, for "wait")

like image 143
skeller88 Avatar answered Oct 16 '22 19:10

skeller88


For vs code it means that forgot to pass the wait flag to code.

wrong:

    editor = code

correct:

    editor = code --wait
like image 33
felix-ht Avatar answered Oct 16 '22 19:10

felix-ht