如何退出Git中的文本窗口? [英] How do I exit from the text window in Git?

查看:555
本文介绍了如何退出Git中的文本窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Windows,在提交之前,Git希望我输入文本消息并出现一个新的文本窗口。





我该如何退出?

我正在学习Git。所以,有一点帮助会受到高度赞赏。

解决方案

既然你在学习Git,知道这与git没什么关系但配置文本编辑器以供使用。在vim中,可以按 i 开始输入文本并按 esc 和保存: wq 输入,这将会提交您输入的信息。在你目前的状态下,如果没有提交,你可以做:q ,而不是像前面提到的:wq 以上。



另外,您可以只执行 git commit -m'< message>',而不是让git打开编辑器输入消息。



请注意,您也可以更改编辑器并使用您喜欢的东西(如记事本) - 如何设置编辑器以在Windows上使用Git ?


I am using Windows and before committing, Git wants me to enter a text message and a new text window appears.

How can I exit from this?

I am trying to learn Git. So, a little help will be highly appreciated.

解决方案

Since you are learning Git, know that this has little to do with git but with the text editor configured for use. In vim, you can press i to start entering text and save by pressing esc and :wq and enter, this will commit with the message you typed. In your current state, to just come out without committing, you can do :q instead of the :wq as mentioned above.

Alternatively, you can just do git commit -m '<message>' instead of having git open the editor to type the message.

Note that you can also change the editor and use something you are comfortable with ( like notepad) - How can I set up an editor to work with Git on Windows?

这篇关于如何退出Git中的文本窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆