在提交消息中,有一条规则说:
"以'#'开头的行将被忽略"
现在我很困惑,如果这些线被忽略,为什么我们一直使用它们呢?
运行"git log"只显示##未启动的行,并且不显示忽略的行.
是否有任何命令显示以'#'开头的行?
好吧,当你写作时,git commit你通常需要编辑提交消息.
作为提醒,有很多#行,它们将显示将提交的内容(重命名,新增,修改)以及将被忽略的内容.我认为这个功能非常有用 - 但是我不想在稍后的提交消息中看到它.
例:
# Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # On branch master # Changes to be committed: # (use "git reset HEAD ..." to unstage) # # modified: file_a.doc # deleted: file_b.jpg # # Untracked files: # (use "git add ..." to include in what will be committed) # # directory/
我认为这就是#行的全部原因.
| 归档时间: |
|
| 查看次数: |
272 次 |
| 最近记录: |