交互式 rebase 的 Git 问题
这基本上是发生的事情:
> git rebase -i HEAD~3
Successfully rebased and updated refs/heads/master.
弹出我的文本编辑器,然后在我有机会做任何事情之前立即“完成”变基。有谁知道可能是什么原因造成的?
我在 Windows 7 上使用 msysgit:git 版本 1.7.3.1.msysgit.0
This is basically what happens:
> git rebase -i HEAD~3
Successfully rebased and updated refs/heads/master.
Pops open my text editor then immediately "completes" the rebase before I even have the chance to do anything. Anyone know what might be causing this?
I'm using msysgit on Windows 7: git version 1.7.3.1.msysgit.0
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
这可能是因为 Git 期望文本编辑器将停止并等待您完成编辑后再继续。您的文本编辑器可能会以这样一种方式启动:在 Git 看来,它似乎立即完成了。
您可以尝试将 EDITOR 环境变量设置为指向执行以下操作的批处理文件:(
但这只是猜测,我现在无法对其进行测试)。
This is probably because Git expects that the text editor will stop and wait until you have finished editing before continuing. Your text editor could start up in such a way that it appears that it immediately finished as far as Git can see.
You could try setting the
EDITOR
environment variable to point to a batch file that does something like:(but this is just a guess and I'm not in a situation to test it right now).
我使用 Atom - 并遇到了同样的问题。
...立即为我修好了。
有关设置不同代码编辑器的更多信息可以在此处找到:
https://help.github.com/articles/associating-text -editors-with-git/
I use Atom - and was getting the same problem.
... fixed it for me straight away.
More info about setting up different code editors can be found here:
https://help.github.com/articles/associating-text-editors-with-git/
已解决,与 git-config 中的编辑器变量相关:
How do我将 Notepad++(或其他)与 msysgit 一起使用?
Solved, related to the editor variable in git-config:
How do I use Notepad++ (or other) with msysgit?
我在使用Notepad++时遇到了同样的问题。
我处于 Notepad++ 的管理员模式。
回到正常模式解决了我的问题。
I was using the Notepad++ while I encountered the same issue.
I was in the Administrator mode of Notepad++.
Back to normal mode solved my issue.