jiexishede
jiexishede

Reputation: 2613

How to input "#" in git commit window?

How to input "#" in the Git commit window?
It always turns into a comment when I type "#".
What should I do to enter "#" in the git commit window?
Information beginning with the # sign.

Upvotes: 0

Views: 290

Answers (2)

jthill
jthill

Reputation: 60313

Besides configuring a different comment character you can use the --cleanup option, git commit --cleanup=verbatim means do no cleanup at all on the message text.

Git's got a command for answering simple questions like this, git help, try it, you'll like it. I found the answer to your question by saying git help commit and reading for less time than it took you to type your question.

Upvotes: 1

Dmitry Minkovsky
Dmitry Minkovsky

Reputation: 38143

Check out the core.commentChar configuration. https://sadique.io/blog/2013/04/14/configure-gits-comment-character/. It allows you to configure which character is used for comments, so you can set it to something other than # and then use # at the beginning of the commit message.

You can set this option like:

git config core.commentChar ";"

Upvotes: 1

Related Questions