LoginSignup
2
1

More than 3 years have passed since last update.

git commit時のチェック処理を無効化したい

Posted at

git commit時にhuskey等を使って、事前にチェックをしている処理なんかがあると思います。
そちらの制約に引っかかって、うまくgit commitできないケースがあると思います。

一時的にチェック処理を外したい場合は--no-verifyオプションを使用します。

例えばこんなケース

package.jsonにこうした記述があると、git commit時にyarnの処理が走って、こちらのケースだとeslintのチェックが入ります。(huskyも入っているハズ)

package.json
"lint-staged": {
    "**/*.js": [
      "yarn run eslint --fix hoge/*.jsx",
      "git add"
    ]
  }

無視するには

もちろんチェックすることは良い事ではあると思いますが、一時的に無視したい場合は、git commit時に--no-verifyのオプションをつけると無視することが出来ます。

git commit --no-verify
2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1