如何在git中执行常规提交消息(Bitbucket)

发布于 2025-01-21 17:58:21 字数 232 浏览 1 评论 0 原文

我正在寻找一种防止提交消息格式没有正确格式的提交的方法。
我打算使用以下约定:
https://www.conventionalcommits.org/en/v1.0.0/”

.git/hooks/,

但是,我不确定如何编写脚本以在提交消息上执行格式。

将相应地编辑,谢谢您。

I'm looking for a way to prevent commits which have no correct format for the commit message.
I intend to use the following convention:
https://www.conventionalcommits.org/en/v1.0.0/

I found out there is a folder with bash scripts which may be the key to that solution: .git/hooks/

However, I'm not sure how to write the script to enforce the format on the commit messages.

Will edit accordingly, thank you in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

‘画卷フ 2025-01-28 17:58:21

文档中有一个

我的建议是:

  1. 选择一个工具。
  2. 从命令行运行它,看看是否可以将其获取以检查提交消息。
  3. 将您用于检查git挂钩的命令。

There is a list of Tools in the documentation.

My suggestion would be to:

  1. Pick a tool.
  2. Run it from the command line, and see if you can get it to check commit messages.
  3. Put the commands you use to check commits messages in a git hook.
新一帅帅 2025-01-28 17:58:21

官方常规委员会网站维护帮助执行,管理和配置。

我已经直接链接到它,因为它在所在的网站上并不明显。对于任何好奇的人来说,它都在“关于”部分。

列表并不详尽,而是一个很好的起点。这些工具各不相同,从处理规则执行和标准的“完整”解决方案到简化了过程的单个部分的“帮助者”。探索并找到最适合您的工具。

The official Conventional Commits website maintains a list of tools to aid in enforcement, management and configuration.

I've linked to it directly, as it isn't immediately obvious on the site where that is. For anyone curious, it is under the "about" section.

The list is not exhaustive, but a very good place to start. The tools are varied, ranging from "complete" solutions that handle rule enforcement and standards, to "helpers" that simplify a single part of the process. Explore and find the tools that work best for you.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文