"git commit --amend" 在 Windows 10 cmd 中打开的这个编辑器是什么,我该如何使用它?
What is this editor opened by "git commit --amend" in Windows 10 cmd and how do I use it?
Windows 10 cmd 在我尝试编辑 GIT 提交消息时默认打开此编辑器。你能告诉我那是什么以及我如何使用它吗?谢谢。
它是 Vi,你必须写下你的消息。
如果您不熟悉 VI,我建议您阅读 this interactive tutorial
编辑文件并编写提交消息(插入模式)
我
要保存您的数据:
写入+退出:ESC + : + w + q + 输入
要保存您的数据但不保存数据:
写入+退出:ESC + : + q + ! + 输入
它是 Vim,Git 安装中的默认编辑器。如果您不会使用它,则很难使用!它不像 Notepad++、Emacs 或 Sublime Text 等其他编辑器那样简单,尽管它非常强大,而且当你掌握它时(需要几个月的努力!:)),你会变得非常高效。
不过,您可以轻松地配置 git 以使用其他编辑器。启动命令行并输入:
git config --global core.editor notepad
现在 Windows 记事本是 git 中的默认编辑器。您可以轻松地将其更改为您选择的任何编辑器。参见 here or here or here。
顺便推荐一下put the time and learn Vim! You'll not regret it :)
尝试 git config --global core.editor(您选择的任何编辑器,或者如果您有以下任何编辑器:Atom / Sublimetext/ notepad++/ notepad / 等)
在为 git 编码时在 Visual studio 终端中或在任何命令行中。
示例:-
git 配置 --global core.editor Atom
Windows 10 cmd 在我尝试编辑 GIT 提交消息时默认打开此编辑器。你能告诉我那是什么以及我如何使用它吗?谢谢。
它是 Vi,你必须写下你的消息。
如果您不熟悉 VI,我建议您阅读 this interactive tutorial
编辑文件并编写提交消息(插入模式)
我
要保存您的数据:
写入+退出:ESC + : + w + q + 输入
要保存您的数据但不保存数据:
写入+退出:ESC + : + q + ! + 输入
它是 Vim,Git 安装中的默认编辑器。如果您不会使用它,则很难使用!它不像 Notepad++、Emacs 或 Sublime Text 等其他编辑器那样简单,尽管它非常强大,而且当你掌握它时(需要几个月的努力!:)),你会变得非常高效。
不过,您可以轻松地配置 git 以使用其他编辑器。启动命令行并输入:
git config --global core.editor notepad
现在 Windows 记事本是 git 中的默认编辑器。您可以轻松地将其更改为您选择的任何编辑器。参见 here or here or here。
顺便推荐一下put the time and learn Vim! You'll not regret it :)
尝试 git config --global core.editor(您选择的任何编辑器,或者如果您有以下任何编辑器:Atom / Sublimetext/ notepad++/ notepad / 等)
在为 git 编码时在 Visual studio 终端中或在任何命令行中。
示例:- git 配置 --global core.editor Atom