I am just learning git and the terminal and I wanted to make a test commit but I cannot seem to be able to escape the text editor window to save the commit
How to escape the git commit window from OS X terminal
gitterminal
Related Question
- MacOS – error: There was a problem with the editor ‘vi’ when using it with git
- How to uninstall Git
- MacOS – git commit editor error ‘subl -n -w’
- How to cd into the local git repo from an AppleScript
- MacOS – Is it normal to have the home directory under git
- How to set Xcode as core.editor in git
- MacOS – How to restore default Apple Version of Git after renaming it in Mac OS Mojave and linking git to homebrew version
Best Answer
It looks like you're inside the
vi
editor. Typing:wq
and pressing enter should do it, i.e. save the commit message and exit.:
enters the command mode,w
is for "write" (save) andq
is for "quit".You may need to hit escape before
:wq
to exit the insert mode (vi
is a mode based editor).If you want to exit without saving hit escape,
:q!
and enter.git opens your default editor so you can edit the commit message. You can change the default editor, even to graphical text editors (such as Sublime Text). See here for example.