Windows 10 cmd opens up this editor by default when I try to edit a GIT commit message. Can you please tell me what that is and how I can use it? Thanks.
It is Vim, the default editor in Git installation. It is rather hard to use if you don't know how to use it! It is not trivial as other editors like Notepad++, Emacs or Sublime Text, though it is very powerful, and when you mastered it (it takes a few month of hard work! :) ), you'l become highly productive.
However you can easily configure git to use another editor. Fire up a command line and enter:
git config --global core.editor notepad
Now Windows Notepad is your default editor in git. You can easily change it to any editor of your choice. See here or here or here.
By the way, I recommend you to put the time and learn Vim! You'll not regret it :)
git config --global core.editor nano
. Way easier to learn, works on all Unix systems (including macOS) and I just tested it on Windows with git. Works like a charm! –
Sitra It Vi and you have to write your message.
If you are unfamiliar with VI i recommend to go over this interactive tutorial
To edit the file and to write your commit message (insert mode)
i
To save your data:
Write + quit: ESC + : + w + q + Enter
To save your without saving data:
Write + quit: ESC + : + q + ! + Enter
ESC
+w
+q
does not work for me. But ESC
+ :
+ w
+ q
+ ENTER
works. What am I doing wrong? –
Boles try git config --global core.editor (any editor of your choice or if you have any of the following: Atom / Sublimetext/ notepad++/ notepad / etc)
in either Visual studio terminal while coding for git or in any command line.
example:- git config --global core.editor Atom
© 2022 - 2024 — McMap. All rights reserved.