PRE-COMMIT-RUN(1)

πŸ“¦ version 4.7.0, in epel 10, fedora 43, fedora 44

✨ 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 to auto, 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 runs git-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 of commit-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 by git-push(1). 🌐
  • --local-branch LOCAL_BRANCH β€” local branch ref used by git-push(1). 🏠
  • --from-ref, --source, -s FROM_REF β€” (for usage with --to-ref) this one represents the original ref in a from_ref...to_ref diff expression. for pre-push hooks, it's the branch you're pushing to. for post-checkout hooks, 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 a from_ref...to_ref diff expression. for pre-push hooks, it's the branch being pushed. for post-checkout hooks, 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 during commit-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 by git-push(1). 🏷️
  • --remote-url REMOTE_URL β€” remote url used by git-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 a post-merge hook, indicates whether the merge was a squash merge. πŸ₯ž
  • --rewrite-command REWRITE_COMMAND β€” during a post-rewrite hook, specifies the command that invoked the rewrite. πŸ”

πŸ”₯ SEE ALSO πŸ”₯

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