PRE-COMMIT-RUN(1)
β¨ pre-commit-run β¨
okay bestie so this is a User Commands manpage, section 1, and it's all about pre-commit run β the little command that actually fires your hooks. iykyk. π
πΈ NAME πΈ
pre-commit-run β run hooks. that's it, that's the whole vibe. π
π¦ SYNOPSIS π¦
pre-commit run [-h] [--color {auto,always,never}] [-c CONFIG]
[--verbose] [--all-files | --files [FILES ...]]
[--show-diff-on-failure]
[--hook-stage {commit-msg,post-checkout,post-commit,post-merge,post-rewrite,pre-commit,pre-merge-commit,pre-push,pre-rebase,prepare-commit-msg,manual}]
[--remote-branch REMOTE_BRANCH] [--local-branch LOCAL_BRANCH]
[--from-ref FROM_REF] [--to-ref TO_REF]
[--pre-rebase-upstream PRE_REBASE_UPSTREAM]
[--pre-rebase-branch PRE_REBASE_BRANCH]
[--commit-msg-filename COMMIT_MSG_FILENAME]
[--prepare-commit-message-source PREPARE_COMMIT_MESSAGE_SOURCE]
[--commit-object-name COMMIT_OBJECT_NAME] [--remote-name REMOTE_NAME]
[--remote-url REMOTE_URL] [--checkout-type CHECKOUT_TYPE]
[--is-squash-merge IS_SQUASH_MERGE] [--rewrite-command REWRITE_COMMAND]
[hook]
she's long, she's gorgeous, she ate. π
π OPTIONS π
π POSITIONAL ARGUMENTS π
hookβ the one (1) hook-id you wanna run. just the one. main character behaviour only. β¨
π«Ά OPTIONAL ARGUMENTS π«Ά
-h,--helpβ shows you a help message and then dips. exit. bye. π--color {auto,always,never}β whether to use color in the output. defaults toauto, so she decides for herself bestie. π¨-c,--config CONFIGβ path to an alternate config file. not the default one, a different one. go off. ποΈ--verbose,-vβ ngl there's no description here in the original, she just exists. iconic silent treatment. π--all-files,-aβ run on all the files in the repo. every single one. no skipping. πββοΈ--files [FILES ...]β specific filenames to run hooks on. you pick, queen. π--show-diff-on-failureβ when the hooks fail, it runsgit-diff(1)directly afterward. so you can see exactly what went wrong, live and in 4K. π--hook-stage {commit-msg,post-checkout,post-commit,post-merge,post-rewrite,pre-commit,pre-merge-commit,pre-push,pre-rebase,prepare-commit-msg,manual}]β the stage during which the hook is fired. one ofcommit-msg,post-checkout,post-commit,post-merge,post-rewrite,pre-commit,pre-merge-commit,pre-push,pre-rebase,prepare-commit-msg,manual. pick your moment bestie, timing is everything. β°--remote-branch REMOTE_BRANCHβ remote branch ref used bygit-push(1). π--local-branch LOCAL_BRANCHβ local branch ref used bygit-push(1). π--from-ref,--source,-s FROM_REFβ (for usage with--to-ref) this one represents the original ref in afrom_ref...to_refdiff expression. forpre-pushhooks, it's the branch you're pushing to. forpost-checkouthooks, it's the branch that was previously checked out. the before pic. πΈ--to-ref,--origin,-o TO_REFβ (for usage with--from-ref) this one represents the destination ref in afrom_ref...to_refdiff expression. forpre-pushhooks, it's the branch being pushed. forpost-checkouthooks, it's the branch that is now checked out. the after pic. π¦--pre-rebase-upstream PRE_REBASE_UPSTREAMβ the upstream from which the series was forked. π±--pre-rebase-branch PRE_REBASE_BRANCHβ the branch being rebased, and it is not set when you're rebasing the current branch. noted. π--commit-msg-filename COMMIT_MSG_FILENAMEβ filename to check when running duringcommit-msg. π--prepare-commit-message-source PREPARE_COMMIT_MESSAGE_SOURCEβ source of the commit message (typically the second argument to.git/hooks/prepare-commit-msg). π--commit-object-name COMMIT_OBJECT_NAMEβ commit object name (typically the third argument to.git/hooks/prepare-commit-msg). β--remote-name REMOTE_NAMEβ remote name used bygit-push(1). π·οΈ--remote-url REMOTE_URLβ remote url used bygit-push(1). π--checkout-type CHECKOUT_TYPEβ indicates whether the checkout was a branch checkout (changing branches,flag=1) or a file checkout (retrieving a file from the index,flag=0). binary king. π--is-squash-merge IS_SQUASH_MERGEβ during apost-mergehook, indicates whether the merge was a squash merge. π₯--rewrite-command REWRITE_COMMANDβ during apost-rewritehook, specifies the command that invoked the rewrite. π
π₯ SEE ALSO π₯
pre-commit-autoupdate(1)pre-commit-clean(1)pre-commit-gc(1)pre-commit-init-templatedir(1)pre-commit-install(1)pre-commit-install-hooks(1)pre-commit-migrate-config(1)pre-commit-sample-config(1)pre-commit-try-repo(1)pre-commit-uninstall(1)pre-commit-validate-config(1)pre-commit-validate-manifest(1)pre-commit-help(1)
and also:
ngl there's no BUGS section, no ENVIRONMENT section, no exit statuses here β the original just said what it said, and we respect her privacy. π
okay that's the whole page bestie, go run those hooks, you're doing amazing sweetie π«Άπβ¨
this little love letter is from the pre-commit source, February 2025 era β mwah, bye ππ§πΈ
π¦ where this page comes from
- epel 10: pre-commit 4.7.0-1.el10_3 Β· MIT
- fedora 43: pre-commit 4.3.0-3.fc43 Β· MIT
- fedora 43: pre-commit 4.6.2-1.fc43
- fedora 43: pre-commit 4.7.0-1.fc43 Β· MIT
- fedora 44: pre-commit 4.5.1-2.fc44 Β· MIT
- fedora 44: pre-commit 4.6.2-1.fc44
- fedora 44: pre-commit 4.7.0-1.fc44 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms