How to construct a better commit message using Vim editor? The purpose of this tutorial is to teach you to create better commit messages so the reviewer can do a more thorough review. At first, It is confusing to use the Vim editor, but I did some research and documented a step by step process to do it:
git add .
to add your changes to your upcoming commit. Step 2: Open a Vim editor.
git commit
If your encountererror: There was a problem with the editor 'vi'.run this in your command line
git config --global core.editor /usr/bin/vimand do it again.
Use the
git commit command without any flags. The VIM editor will open.
git commit By pressing the
i key (Insert mode) on your keyboard you can now start typing and create a better commit message. So your goal here is to write a message that explains well your changes.
VIM editor Once you are done, press
esc key (exit insert mode) then type
:wq and press
enter to save your commit message and close the Vim editor.
Step 3: Lastly push your commit
git push origin [branch_name where your commit at]