Choosing your Git editor¶
In this video, we show how to use nano and vim for writing commit messages. See below for brief instructions on how to use these editors.
Tip
This editor is only used for writing commit messages. It is entirely separate from your choice of editor for any other task, such as writing code.
Video timeline:
Note
You can pause the video to select and copy any of the text, such as the git config --global core.editor
commands.
How to use nano¶
Once you have written your commit message, press Ctrl + O and then Enter to save the commit message, then press Ctrl + X to quit the editor.
To quit without saving press Ctrl + X.
If you have made any changes, nano
will ask if you want to save them.
Press n to quit without saving these changes.
How to use vim¶
You need to press i (switch to insert mode) before you can write your commit message. Once you have written your commit message, press Esc and then type :wq to save your changes and quit the editor.
To quit without saving press Esc and then type :q!.