question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to disable pre-commit hooks?

See original GitHub issue

I use lint-staged with husky. When I do yarn commit, hooks are run twice: first by lint-staged, then by git-cz. Is there an option to make git-cz not to run hooks?

mobile-app git:(setup) $ yarn commit
yarn commit v0.21.3
$ lint-staged
 ↓ Running tasks for *.js [skipped]
   → No staged files match *.js
$ git-cz 
/Users/sergey/dev/mobile-app
/Users/sergey/dev/mobile-app
cz-cli@2.9.6, cz-conventional-changelog@2.0.0

Line 1 will be cropped at 100 characters. All other lines will be wrapped after 100 characters.

? Select the type of change that you're committing: chore:    Other changes that don't modify src or test files
? Denote the scope of this change ($location, $browser, $compile, etc.):
 flow
? Write a short, imperative tense description of the change:
 ignore `native-base` and its deps
? Provide a longer description of the change:
 
? List any breaking changes:
 
? List any issues closed by this change:
 

> husky - npm run -s precommit

 ↓ Running tasks for *.js [skipped]
   → No staged files match *.js
[setup 4f5f419] chore(flow): ignore `native-base` and its deps
 1 file changed, 4 insertions(+)
✨  Done in 10.31s.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
jimthedevcommented, May 9, 2017

You can skip git hooks with git cz --no-verify

1reaction
Maransattocommented, Feb 12, 2020

You can skip git hooks with git cz --no-verify

Hi. I tried using this syntax and it worked fine, but when I executed it inside a bash script it still calling husky and commitizen.

husky > prepare-commit-msg (node v12.15.0)
cz-cli@4.0.3, cz-conventional-changelog@3.1.0

? Select the type of change that you're committing:

Example, inside a bash script (.sh)

  echo "Subindo pro git ... "
  echo
  git add backup-$SIGLA.sql
  git commit -m "build(backup-$SIGLA.sql): base $SIGLA atualizada" --no-verify
  git push
  echo "OK"
Read more comments on GitHub >

github_iconTop Results From Across the Web

Skip Git commit hooks - Stack Overflow
" git commit " used to discard the index and re-read from the filesystem just in case the pre-commit hook has updated it...
Read more >
a way to disable certain pre-commit hooks on pre-commit.ci #7
I currently run https://github.com/mgedmin/check-manifest as a pre-commit hook, and it accesses the internet as part of the build, ...
Read more >
pre-commit
It is a multi-language package manager for pre-commit hooks. You specify a list of hooks you want and ... Uninstall the pre-commit script....
Read more >
Disable pre-commit hooks when merging. - YouTrack - JetBrains
Workaround · Add this code at the top of .git/hooks/pre-commit or any other hooks you have. · Create a file called .skip-hooks with...
Read more >
Git Hooks - Git SCM
The pre-commit hook is run first, before you even type in a commit message. ... but the client doesn't disconnect until it has...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found