git rebase -i presents an empty MacVim file

时间秒杀一切 提交于 2019-12-13 12:25:36

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!