问题
I'm trying to rebase a commit. However, any time I run git rebase -i f83eff3ffc8
, for example, a MacVim window opens, that's empty (there is no information in the file). Then once I write and close the file (even though it's empty), I get a Successfully rebased and updated refs/heads/clicktocall-hotfix
message.
The file name is .git/rebase-merge/git-rebase-todo
. I also tried running it with sudo but this didn't make a difference.
What could be the problem? I've never successfully completed a rebase.
回答1:
I was using Macvim and needed to run mvim with the -f
option, as documented here: GIT_EDITOR not working with macvim
回答2:
For atom I was able to fix by adding the wait flag to gitconfig (reference https://help.github.com/articles/associating-text-editors-with-git/)
[core]
editor = atom --wait
回答3:
You should not even have to look at the git-rebase-todo
file. Vim should display a noop line and some comments. After saving that, you should get "Successfully rebased and updated ".
You are either using an old version of git, you have a broken git install or you have touched the .git folder in some way to cause it to behave this way.
回答4:
I was using Atom and run into this problem. I set my default editor like this:
export VISUAL=vim
export EDITOR="$VISUAL"
Now everything is working great.
TL;DR; Use Vim.
来源:https://stackoverflow.com/questions/8723316/git-rebase-i-presents-an-empty-macvim-file