As I get an editor (vi) when doing a git commit -m I'd like to get an editor doing
git tag myTagName -m
as my comment will contain code with quotes and I'd like to avoid escaping it!
When tagging, give the parameter -a so git can see that this tag is "annotated", then git will open your editor to input the text.
For example:
git tag -a v1.0
From the Git documentation:
If one of
-a,-s, or-u <keyid>is passed, the command creates a tag object, and requires a tag message. Unless-m <msg>or-F <file>is given, an editor is started for the user to type in the tag message.If
-m <msg>or-F <file>is given and-a,-s, and-u <keyid>are absent,-ais implied.Otherwise, a tag reference that points directly at the given object (i.e., a lightweight tag) is created.
As you may know, there are several kinds of tags in Git. When you used -m <msg>, you were implying -a (annotated tag). If you want to see the editor to provide the message, while still creating an annotated tag, simply use -a instead.
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