【问题标题】:Git get file list in prepare-commit-msg hookGit在prepare-commit-msg钩子中获取文件列表
【发布时间】:2021-11-30 09:37:16
【问题描述】:

我想编写一个钩子,根据更改文件的路径准备提交消息。那个阶段有可能得到这样的文件列表吗?

我检查了githooks 手动条目,但它有点稀疏。

【问题讨论】:

    标签: git hook pre-commit-hook commit-message


    【解决方案1】:

    在脚本中使用git diff --cached --name-only -r

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-09-29
      • 2018-07-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多