我想提交消息和扩展描述文本到Bitbucket服务器。它存在于Git-cola
软件,我需要它的命令行。我使用Ubuntu的,我需要为Extended description
Git上的扩展描述文本
git commit -am "My commit text" "My Extended description is this. Containing break lines in it."
我想提交消息和扩展描述文本到Bitbucket服务器。它存在于Git-cola
软件,我需要它的命令行。我使用Ubuntu的,我需要为Extended description
Git上的扩展描述文本
git commit -am "My commit text" "My Extended description is this. Containing break lines in it."
终端命令中有没有混帐“扩展描述”的概念。只有提交信息。会发生什么是提交消息可以有一个单行行或多行行。
外部工具或网站,如git的可乐或GitHub的可以解释多行提交消息为:
对于一行消息,仅定义了“简短描述”。
有关详细信息,请参见GitHub commit with extended message。
由于ckruczek建议您可以简单地git commit
没有选项,文本编辑器将产生,只需写第一行作为简短描述,其余作为扩展描述。
如果您想从命令行执行此操作,则可以使用此问题中提到的其中一个选项:Add line break to git commit -m from command line。
例如使用bash,你可以这样做:
git commit -m 'Message
goes
here'
也可以使用 “在这里记录” 语法:
git commit -F- <<EOF
Message
goes
here
EOF
PS:例如直接从答案采取Add line break to git commit -m from command line。积分Simon Ritcher和jpmc26。
作为第三个方法,你也可以使用一个临时文件:
echo $comment > message.tmp
echo $extended >> message.tmp
git commit -F message.tmp
rm message.tmp
也有另一种选项(在this question answer还介绍):您可以指定使用“-m
”选项多次多封邮件:
git commit -m "Short description" -m "Extended description"
要小心,因为,指定这种方式,消息将被视为段落,从而与否有关空行分隔。
-m <MSG>
--message = <MSG>使用给定的<MSG>作为提交消息。如果给出了多个-m选项,它们的值将作为单独的段落连接起来。
当你git commit
,你会得到一个编辑器。第一行是提交的主题,应该是现在连续式的简短描述(少于50个字符)。然后一个新的行和一个“扩展描述”应该包含更多细节包装成72列。这可能是git可乐正在做的事。 http://chris.beams.io/posts/git-commit/是一篇关于提交消息结构的好文章。
只是'git commit'。这产生了默认的编辑器。 – ckruczek