GitHub formatting captures messages from the shell

I just read Writing good commit messages and he really enjoyed it. The problem is that I prefer the command line (plain ole ' git ).

  • How to add new lines and tabs for fixing messages in order to have a “summary line” and a message body (which may consist of several paragraphs)?
  • Does GitHub support markdown in its commit messages? After reading "Shiny New Fixing Styles" this is not possible
+5
source share
2 answers

git automatically generates your preferred $EDITOR to request a commit message when you run git commit . So it can be as simple as leaving -m with your git commit command

If git starts the wrong editor or doesn't start the editor, try setting the EDITOR environment EDITOR to your preferred editor:

 export EDITOR=/usr/bin/vim 

Or, to change the editor used by git, you can set core.editor

 git config --global core.editor /usr/bin/vim 

Using an editor to compose a commit message in this way has several additional advantages. git fills out the file you are editing, with the sum of the files that were changed in the commit, which should help you write the best commit message. In addition, vim (and other editors) support basic syntax highlighting for this type of file, which makes it even easier.

+10
source
+3
source

Source: https://habr.com/ru/post/1215306/


All Articles