When I tag versioned code in git, I like using bullet points in the tag message.
This can easily be done with annotated tags:
git tag -a v1.0.0
* Change number 1
* Change number 2
#
# Write a tag message
#
However, if I attempt the same tag with the -m option, the tag message is not what I expect:
git tag -a v1.0.0 -m "* Change number 1\n* Change number 2"
git show v1.0.0
...
* Change number 1\n* Change number 2
....
The '\n' was interpreted literally as the characters '\' and 'n' instead of a newline. I want to use the -m
option so that I can automate the tagging process.
Is there any way to include actual newline characters using git tag
with the -m
option?
Assuming you're using a unix shell, your syntax for newline is wrong.
git tag -a v1.0.0 -m "* Change number 1
* Change number 2"
should work.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With