Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Skip githooks on git push

Tags:

git

push

githooks

Intro: I recently installed some software which fires on the git pre-push hook. Unfortunately there is a mistake in the software, and it crashes on very large commits.

Is it possible to run an git push without triggering the githooks?

That way I don't have to uninstall the githook?

like image 976
Automatico Avatar asked Apr 09 '15 18:04

Automatico


People also ask

How do you bypass a pre Push hook?

Quick tip if you want to skip the pre-commit validations and quickly want to get a commit out there. To get your commit through without running that pre-commit hook, use the --no-verify option. Voila, without pre-commit hooks running!

How do you commit without a hook?

Use git commit --no-verify -m <message> to commit staged changes without running git hooks.

How do I ignore a commit?

If you want to ignore a file that you've committed in the past, you'll need to delete the file from your repository and then add a . gitignore rule for it. Using the --cached option with git rm means that the file will be deleted from your repository, but will remain in your working directory as an ignored file.


1 Answers

After reading through some of the githook documentation I found that the pre-commit hook could be omitted with the flag --no-verify.

Although it was not mentioned, --no-verify also works on git push :)

like image 139
Automatico Avatar answered Oct 01 '22 01:10

Automatico