2017-05-16 16 views
0

我想通過使用VIM添加一個Git提交,如圖片。 第二行,我想添加一個提交文本「#2355修復這個問題的一個bug」,但是vim認爲這是一個註釋,vim會忽略這一行,那麼我該怎麼做。如何和'#'在VIM但不使用評論

enter image description here

+0

你可以改變註釋字符'core.commentChar',這裏http://stackoverflow.com/questions/2788092/看看啓動一個git-commit-message-with-a-hashmark和這裏http://stackoverflow.com/questions/22936252/escape-comment-character-in-git-commit-message –

+0

謝謝@Ôrel,我關注你提示,已解決 – jimbo

回答

2

它不VIM,它的GIT中:根據文檔:

A '#' 或 ';'字符表示評論。

需要注意的是,你可以每庫更改此:

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 #). 
3

線開始以 '#' 將被忽略,和一個空的消息,中止犯。

只是不啓動你的提交信息與#

fix bug #2355 of this issues 
+0

我用「git config core.commentchar'*'」解決了問題。如果開始提交#會自動將提交與issuse相關聯。 – jimbo