我的公司有一项政策,即对特定项目的所有签入都必须遵循 git 提交的特定多行模板。如何最简单地从 Windows 命令行创建一条包含多行的提交消息?
This is almost exactly a duplicate of "Add line break to git commit -m from command line https://stackoverflow.com/questions/5064563/add-line-break-to-git-commit-m-from-command-line" except that this question is specific to Windows/cmd.exe, while that question is related to bash.
创建一个包含正确格式的提交消息的文件并使用git commit -F <message_file>
,之后您可以继续编辑和重用同一文件,或者创建模板文件并使用git commit -t <template_file>
打开编辑器,其中包含要填写的预煮模板。第二个选项可以通过设置来永久保存commit.template
配置变量,所以你不需要使用-t ...
每次提交都会被占用。请参阅git commit
手册页(git help commit
, 如果你的git
是否安装正确,或者网上搜索)了解更多信息。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)