0

i want add a git commit by use vim, like the picture. second line, I want add a commit text "#2355 fix a bug of this issues", but the vim think this is a annotations , vim will ignore this line , so what should I do.

enter image description here

Ingo Karkat
  • 167,457
  • 16
  • 250
  • 324
jimbo
  • 42
  • 1
  • 7
  • you can change the comment char `core.commentChar`, take a look here http://stackoverflow.com/questions/2788092/start-a-git-commit-message-with-a-hashmark and here http://stackoverflow.com/questions/22936252/escape-comment-character-in-git-commit-message – Ôrel May 16 '17 at 09:19
  • thanks @Ôrel, i follow your tip ,resolved – jimbo May 16 '17 at 09:42

2 Answers2

3

Lines starting with '#' will be ignored, and an empty message aborts the commit.

Just don't start your commit message with #

fix bug #2355 of this issues
Sardorbek Imomaliev
  • 14,861
  • 2
  • 51
  • 63
  • I have resolved with "git config core.commentchar '*' ". if start commit with # will automatically associate the commit with the issuse. – jimbo May 17 '17 at 01:45
2

It's not vim, it's git: according to the documentation:

A '#' or ';' character indicates a comment.

Note that you could change this per repository:

core.CommentChar
  Commands such as commit and tag that lets you edit messages consider
  a line that begins with this character
  commented, and removes them after the editor returns (default #).
Xavier Nicollet
  • 353
  • 6
  • 12