If git commit pauses before creating a commit, check the hook Git actually runs before blaming Git itself. Find the hook path, separate one-time environment setup from recurring work, then run hooks individually and narrow their file scope. This guide focuses on Git’s pre-commit hook and the pre-commit framework.
Why are my Git commits so slow?
Git runs the pre-commit hook before it obtains the proposed commit message and writes the commit. A hook that fails can stop the commit entirely. The hook may launch pre-commit, a wrapper, or project-specific commands, so the delay may come from any of those steps—not Git’s commit operation itself. See the Git githooks documentation.
Find the hook Git actually launches
Git normally looks for hooks in $GIT_DIR/hooks. The core.hooksPath setting can redirect it to another directory. In a non-bare repository, Git runs hooks from the working tree’s root.
-
Check whether a custom hook directory is configured:
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.#1 Best Overall
Amazon Basics Wired QWERTY Keyboard, Works with Windows, Plug and Play, Easy to Use with Media Control, Full-Sized, Black- KEYBOARD: The keyboard works for Windows with hot keys that enable easy access to Media, My Computer, Mute, Volume up/down, and Calculator
- EASY SETUP: Experience simple installation with the USB wired connection
- VERSATILE COMPATIBILITY: This keyboard is designed to work with multiple Windows versions, including Vista, 7, 8, 10 offering broad compatibility across devices.
- SLEEK DESIGN: The elegant black color of the wired keyboard complements your tech and decor, adding a stylish and cohesive look to any setup without sacrificing function.
- FULL-SIZED CONVENIENCE: The standard QWERTY layout of this keyboard set offers a familiar typing experience, ideal for both professional tasks and personal use.
git config --show-origin --get core.hooksPathIf the command prints a path, inspect that directory. If it prints nothing, check the repository’s Git directory, usually the
hookssubdirectory under.git. -
Read the installed pre-commit hook script. Follow any wrapper or shell commands it calls until you can identify the actual tools and project scripts being run.
A script named pre-commit is only the entry point; its contents determine what is executed. The Git hooks reference describes hook locations and when the pre-commit hook runs.
Rank #2
- Reliable Plug and Play: The USB receiver provides a reliable wireless connection up to 33 ft (1), so you can forget about drop-outs and delays and you can take it wherever you use your computer
- Type in Comfort: The design of this keyboard creates a comfortable typing experience thanks to the low-profile, quiet keys and standard layout with full-size F-keys, number pad, and arrow keys
- Durable and Resilient: This full-size wireless keyboard features a spill-resistant design (2), durable keys and sturdy tilt legs with adjustable height
- Long Battery Life: MK270 combo features a 36-month keyboard and 12-month mouse battery life (3), along with on/off switches allowing you to go months without the hassle of changing batteries
- Easy to Use: This wireless keyboard and mouse combo features 8 multimedia hotkeys for instant access to the Internet, email, play/pause, and volume so you can easily check out your favorite sites
Determine whether the delay is setup or recurring work
On its first run, pre-commit may download and install a hook environment, including a language runtime. Its documentation says those environments are reused on later runs. If the delay happened on the first run after installing or changing hooks, initialization may explain it; if the same hooks have run successfully before and commits remain slow, look for recurring work in their commands.
PC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchTo provision missing environments ahead of a commit, run either:
pre-commit install --install-hooks
or:
pre-commit install-hooks
The pre-commit documentation does not specify a universal runtime or speed threshold, so compare the behavior of your own hooks rather than treating a particular duration as abnormal. See pre-commit’s installation and usage documentation.
Rank #3
- All-day Comfort: The design of this standard keyboard creates a comfortable typing experience thanks to the deep-profile keys and full-size standard layout with F-keys and number pad
- Easy to Set-up and Use: Set-up couldn't be easier, you simply plug in this corded keyboard via USB on your desktop or laptop and start using right away without any software installation
- Compatibility: This full-size keyboard is compatible with Windows 7, 8, 10 or later, plus it's a reliable and durable partner for your desk at home, or at work
- Spill-proof: This durable keyboard features a spill-resistant design (1), anti-fade keys and sturdy tilt legs with adjustable height, meaning this keyboard is built to last
- Plastic parts in K120 include 51% certified post-consumer recycled plastic*
Isolate the hook that takes time
Run a configured hook by its ID to focus on that check and show output even if it succeeds:
pre-commit run <hook_id> --verbose
Repeat for the hook IDs in your configuration, then inspect the slow hook’s executable, arguments, environment, and any project scripts it invokes. This is a way to narrow the culprit, not a benchmark or a guarantee of detailed profiling; profiling further depends on the tool the hook runs.
Recommended Free Tools
Check how many files each hook examines
A normal Git-triggered pre-commit run generally checks staged files. By contrast, pre-commit run --all-files intentionally checks the repository’s files, which can mean substantially more work. Confirm that a hook or wrapper is not calling an all-files command when you expect a staged-file check.
Rank #4
- 【Dreamy Rainbow Gaming Keyboard】K521 Gaming Keyboard Adopts a Different LED Backlight Design, Upgraded on the Traditional LED Backlight Effect, Making the Light More Penetrating, Giving You a More Dazzling Visual Effect, Making Your Gaming Process More Enjoyable
- 【One Touch Opens & Visual Feast】The K521 Red Dragon Keyboard has a One-Touch on/off Lighting Button for Added Convenience. It also has a Three-Position Adjustable Breathing Mode and a Four-Position Adjustable Brightness Lighting Mode
- 【Mechanical Feeling & Fast Tapping】The PC Keyboard Keys are Designed for Mechanical Feeling, Giving You a Better Feel During Use and the Ability to Trigger Keys Quickly, Allowing You to Win All Your Games
- 【19 Keys Anti-Ghosting Keyboard】Anti-Ghosting Ensures Every Button Can Be Triggered. This Allows You to Trigger Key Combinations In The Game Accurately, And Each Skill Can Be Accurately Released to Increase Your Winning Rate. Redragon K521 Will Be Your Perfect Partner
- 【12 Multimedia Combination Keys】The K521 Wired Gaming Keyboard is Equipped with 12 Multimedia Keys That Can Greatly Enhance Your Gaming/Office Efficiency and Make It More Convenient to Use
In .pre-commit-config.yaml, inspect each slow hook’s matching rules and execution settings:
filesandexcludedetermine which paths match or are omitted.types,types_or, andexclude_typesrefine matching by file type.always_runcan invoke a hook even when no matching files are staged.
Adjust filters only when they accurately reflect what the check needs to inspect. For example, excluding irrelevant generated files can reduce needless work, but filtering out files that require validation weakens coverage.
The fail_fast option stops later checks after the first failure. It can avoid running later hooks during a failing run, but it does not inherently make a successful run faster. Hooks also support stages; a check that need not run on every commit can be assigned to another supported stage or run manually, if that fits the project’s workflow. See the pre-commit configuration documentation.
Best Value
- All-day Comfort: This USB keyboard creates a comfortable and familiar typing experience thanks to the deep-profile keys and standard full-size layout with all F-keys, number pad and arrow keys
- Built to Last: The spill-proof (2) design and durable print characters keep you on track for years to come despite any on-the-job mishaps; it’s a reliable partner for your desk at home, or at work
- Long-lasting Battery Life: A 24-month battery life (4) means you can go for 2 years without the hassle of changing batteries of your wireless full-size keyboard
- Simply plug the USB receiver into a USB port on your desktop, laptop or netbook computer and start using the keyboard right away without any software installation
- Simply Wireless: Forget about drop-outs and delays thanks to a strong, reliable wireless connection with up to 33 ft range (5); K270 is compatible with Windows 7, 8, 10 or later
Verify that the pre-commit environment is reusable
By default, pre-commit stores its hook environments in ~/.cache/pre-commit. PRE_COMMIT_HOME overrides that location; otherwise, XDG_CACHE_HOME sets the base directory used for the pre-commit store. Check that the environment in which you commit can access the expected store consistently—for example, if commits run inside a container or another isolated environment.
The documented cache paths are not a reason to delete the cache routinely. Clearing it can require environments to be installed again; consider it only when you have a specific cache problem to resolve. See pre-commit’s cache documentation.
Use a bypass only to test a diagnosis or handle an exception
If you have identified one slow pre-commit hook, skip just that hook for a controlled diagnostic or exceptional commit:
SKIP=<hook_id> git commit -m "message"
This helps confirm whether that hook accounts for the pause. Git also supports git commit --no-verify, which bypasses the pre-commit hook more broadly. Both choices temporarily remove local checks; use the result to fix the hook’s scope or workflow rather than leaving the bypass in place. Git documents --no-verify in its pre-commit hook reference, and pre-commit documents selective skipping at pre-commit.com.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Decide whether a check belongs in CI
Local hooks provide feedback before the commit is created and can check staged changes. CI can run checks after a push and may check changed files or a broader scope. The right split depends on how quickly the check needs to inform the developer, how much code it must cover, whether it can modify files, and whether developers need to work offline.
For a changed-file CI run, pre-commit documents:
pre-commit run --from-ref <base> --to-ref <head>
It also documents running checks across all files in CI and describes pre-commit.ci, which can autofix pull requests and periodically update hook configuration. These are workflow options, not promises of a particular reduction in local commit time. Keep quick, high-value checks local when immediate feedback matters; consider CI for checks whose cost or scope makes them unsuitable for every commit.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




