小编Pot*_*oes的帖子

如何使用 Husky 预提交挂钩访问提交消息?

我的哈士奇脚本:

  "husky": {
    "hooks": {
      "pre-commit": "sh ./tools/githooks/pre-commit.sh"
    }
  }
Run Code Online (Sandbox Code Playgroud)

假设我正在做一个git commit -m "I want that text". 如何在 shell 脚本中访问我的提交消息?我试图在 shell 脚本中回显 $HUSKY_GIT_PARAMS 和 $HUSKY_GIT_STDIN 但没有成功

git pre-commit pre-commit-hook husky git-husky

5
推荐指数
1
解决办法
2563
查看次数

标签 统计

git ×1

git-husky ×1

husky ×1

pre-commit ×1

pre-commit-hook ×1