Git commit in terminal opens VIM, but can't get back to terminal

Trying to learn GitHub at the moment and doing this Git essentials tutorial over at nettuts. I'm on the lesson about making commits.

The teacher types git commit and it opens VIM as his editor (I'd also like to know how to make it open up in Sublime Text 2 instead) anyways it opens in VIM and I add in 1 line saying this is my first commit and hit save.

Next it then prompts me to save the output to the desktop, something I did not see in his screencast. Now I'm still in VIM and not sure how to get back to 'normal' terminal :(

I couldn't figure it out so I just exited the terminal and relaunched it, did git commit again and had some warning messages about duplicates! Not sure if I need to (E)edit anyways or (A)abort .

git status

在这里输入图像描述

vim

在这里输入图像描述

message when I reopen terminal and do git commit again

在这里输入图像描述


To save your work and exit press Esc and then :wq (w for write and q for quit).

Alternatively, you could both save and exit by pressing Esc and then :x

To set another editor do export EDITOR=myFavoriteEdior


不是真正解决VIM问题的答案,但可以使用命令行也输入提交消息:

git commit -m "This is the first commit"

You need to return to normal mode and save the commit message with either

<Esc>:wq

or

<Esc>:x

or

<Esc>ZZ

The Esc key returns you from insert mode to normal mode. The :wq, :x or ZZ sequence writes the changes and exits the editor.

链接地址: http://www.djcxy.com/p/87976.html

上一篇: 如何在切片“屏幕”终端上​​下滚动

下一篇: 终端中的Git commit会打开VIM,但不能回到终端