简体   繁体   English

使用vscode的git commit消息的专用选项卡

[英]Dedicated tab for git commit messages using vscode

When running git commit in the CLI something like the following (default) template is shown (in whatever editor is used): 在CLI中运行git commit时,将显示类似以下(默认)模板的内容(使用任何编辑器):

[empty line]
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# On branch master
# Your branch is up to date with 'origin/master'.
#
# Changes to be committed:
#       modified:   Makefile
#

This allows the user (a) to see the list of items that are going to be affected by the commit and (b) provided a multiline message. 这样,用户(a)可以查看将受提交影响的项目列表,并且(b)提供了多行消息。 In particular, it is common to have a short (<72 chars) first line. 特别是,第一行短(<72个字符)很常见。 An empty line and then a longer message. 空行,然后是一条较长的消息。

When committing from within vscode, I cannot find a way of having a full-fledged editor for the commit message. 从vscode中进行提交时,我找不到为提交消息使用完整的编辑器的方法。 All one has is something like the following: 每个人都有的东西如下:

在此处输入图片说明

Where a multiline message is possible but without the pleasure of an editor. 在可能出现多行消息但没有编辑高兴的地方。

I am currently using 1.23.1. 我目前正在使用1.23.1。

The commit field extends according to the amount of what is put in it. 提交字段根据其内容扩展。 在此处输入图片说明

But, vscode displaying a warning message on commit message length: https://github.com/Microsoft/vscode/issues/18807 但是,vscode在提交消息的长度上显示警告消息: https : //github.com/Microsoft/vscode/issues/18807

That editor is all that is necessary. 那个编辑器就足够了。 Your first line will be used as the message, which as you say should be concise. 您的第一行将用作消息,正如您所说的那样,应该简洁明了。

Multiline messages (ie messages that include line breaks) will automatically consider the second line and beyond to be the "description" on services like GitHub. 多行消息(即包含换行符的消息)将自动将第二行及以后的行视为GitHub等服务的“描述”。

If you'd really like to avoid using this editor, I'd recommend checking out this answer . 如果您真的想避免使用此编辑器,建议您参考以下答案

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM