How to include newline characters in git tag messages
The closest solution I found is to use multiple -m
options, one for each line. For example:
git tag -a v1.0.0 -m "* Change number 1" -m "* Change number 2"
from git-tag man page:
-m <msg>
Use the given tag message (instead of prompting). If multiple
-m options are given, their values are concatenated as separate
paragraphs. (...)
UPDATE: Check "Add line break to git commit -m from command line" for more shell-based solutions.
Best solution is to write your commit and tag messages right from your default code editor.
- Use command
git tag -a v1.0.0
and hit enter. Don't write-m
- It will open up your default code editor, write message, save and close the file.
- Command line will be resumed.