Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Github commit message escape "@" character

Tags:

git

github

When I try to commit with a message containing the @ sign, I always end up tagging an user.

Example: In this message, I'm referring to the @property python decorator, not the github user named "property".

Can I escape this character and avoid creating a link to an user?

Thanks

like image 962
Marco Avatar asked Aug 09 '16 23:08

Marco


2 Answers

There is a way to do it, but it's a bit hacky. Slai was very close to solving it. Instead of pasting the code for the zero width space, you need to paste the actual zero width space. Here is a test commit that shows that it works. Also here is some info about the zero width space character.

Note: The shortcut for Windows on the website does not work. It inserts ♂ instead.
Note2: Don't forget to thank Slai :)

like image 72
nakamin Avatar answered Sep 20 '22 15:09

nakamin


As far as I know, there is no way to escape it.

Even if you try to use the escape sequence \@ or wrap the content within a code tag ``, it will still be rendered as @mention.

Here's two tests I tried:

$ git commit --allow-empty -m 'This is a \@test'
$ git commit --allow-empty -m 'This is a `@test`'

I also tried to use a longer commit message, and place the mention in the longer description. Once more, it did not escape it, neither with \ nor with ``.

like image 38
Simone Carletti Avatar answered Sep 16 '22 15:09

Simone Carletti