[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-7793":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":16,"stars30d":17,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":18,"rankGlobal":10,"rankLanguage":10,"license":19,"archived":20,"fork":20,"defaultBranch":21,"hasWiki":20,"hasPages":20,"topics":22,"createdAt":10,"pushedAt":10,"updatedAt":23,"readmeContent":24,"aiSummary":25,"trendingCount":16,"starSnapshotCount":16,"syncStatus":26,"lastSyncTime":27,"discoverSource":28},7793,"overcommit","sds\u002Fovercommit","sds","A fully configurable and extendable Git hook manager","",null,"Ruby",4008,282,84,30,0,12,29.36,"MIT License",false,"main",[],"2026-06-12 02:01:44","[![Gem Version](https:\u002F\u002Fbadge.fury.io\u002Frb\u002Fovercommit.svg)](https:\u002F\u002Fbadge.fury.io\u002Frb\u002Fovercommit)\n[![Build Status](https:\u002F\u002Fgithub.com\u002Fsds\u002Fovercommit\u002Factions\u002Fworkflows\u002Ftests.yml\u002Fbadge.svg?branch=main)](https:\u002F\u002Fgithub.com\u002Fsds\u002Fovercommit\u002Factions\u002Fworkflows\u002Ftests.yml\u002Fbadge.svg?branch=main)\n[![Coverage Status](https:\u002F\u002Fcoveralls.io\u002Frepos\u002Fgithub\u002Fsds\u002Fovercommit\u002Fbadge.svg?branch=main)](https:\u002F\u002Fcoveralls.io\u002Fgithub\u002Fsds\u002Fovercommit?branch=main)\n[![Maintainability](https:\u002F\u002Fapi.codeclimate.com\u002Fv1\u002Fbadges\u002F5da42f7f365e5fef6b4c\u002Fmaintainability)](https:\u002F\u002Fcodeclimate.com\u002Fgithub\u002Fsds\u002Fovercommit\u002Fmaintainability)\n[![Inline docs](http:\u002F\u002Finch-ci.org\u002Fgithub\u002Fsds\u002Fovercommit.svg?branch=main)](http:\u002F\u002Finch-ci.org\u002Fgithub\u002Fsds\u002Fovercommit)\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Fraw.githubusercontent.com\u002Fsds\u002Fovercommit\u002Fmaster\u002Flogo\u002Fhorizontal.png\" width=\"65%\" alt=\"Overcommit Logo\"\u002F>\n\u003C\u002Fp>\n\n`overcommit` is a tool to manage and configure\n[Git hooks](http:\u002F\u002Fgit-scm.com\u002Fbook\u002Fen\u002FCustomizing-Git-Git-Hooks).\n\nIn addition to supporting a wide variety of hooks that can be used across\nmultiple repositories, you can also define hooks specific to a repository which\nare stored in source control. You can also easily\n[add your existing hook scripts](#adding-existing-git-hooks) without writing\nany Ruby code.\n\n- [Requirements](#requirements)\n  - [Windows](#windows)\n  - [Dependencies](#dependencies)\n- [Installation](#installation)\n  - [Automatically Install Overcommit Hooks](#automatically-install-overcommit-hooks)\n- [Usage](#usage)\n  - [Skipping Hooks](#skipping-hooks)\n  - [Disabling Overcommit](#disabling-overcommit)\n  - [Disabling Colorized Output](#disabling-colorized-output)\n- [Continuous Integration](#continuous-integration)\n- [Configuration](#configuration)\n  - [Hook Options](#hook-options)\n  - [Hook Categories](#hook-categories)\n    - [The `ALL` Hook](#the-all-hook)\n  - [Gemfile](#gemfile)\n  - [Plugin Directory](#plugin-directory)\n  - [Quiet Hook Runs](#quiet-hook-runs)\n  - [Concurrency](#concurrency)\n  - [Signature Verification](#signature-verification)\n- [Built-In Hooks](#built-in-hooks)\n  - [CommitMsg](#commitmsg)\n  - [PostCheckout](#postcheckout)\n  - [PostCommit](#postcommit)\n  - [PostMerge](#postmerge)\n  - [PostRewrite](#postrewrite)\n  - [PreCommit](#precommit)\n    - [WARNING: pre-commit hooks cannot have side effects](#warning-pre-commit-hooks-cannot-have-side-effects)\n  - [PrePush](#prepush)\n  - [PreRebase](#prerebase)\n- [Repo-Specific hooks](#repo-specific-hooks)\n  - [Adding Existing Git Hooks](#adding-existing-git-hooks)\n- [Security](#security)\n  - [Disabling Signature Checking](#disabling-signature-checking)\n- [Contributing](#contributing)\n- [Community](#community)\n- [Changelog](#changelog)\n- [License](#license)\n\n## Requirements\n\nThis project aims to support the following Ruby runtimes on \\*nix (and best effort on Windows):\n\n* Ruby 2.6+\n\n### Dependencies\n\nSome hooks have third-party dependencies. For example, to lint your\n[SCSS](http:\u002F\u002Fsass-lang.com\u002F) files, you're going to need the\n[scss_lint gem](https:\u002F\u002Fgithub.com\u002Fsds\u002Fscss-lint).\n\nDepending on the hooks you enable\u002Fdisable for your repository, you'll need to\nensure your development environment already has those dependencies installed.\nMost hooks will display a warning if a required executable isn't available.\n\nIf you are using Bundler to manage your Ruby gem dependencies, you'll likely\nwant to use the [`gemfile`](#gemfile) option to control which gem versions are\navailable during your hook runs.\n\n## Installation\n\n`overcommit` is installed via [RubyGems](https:\u002F\u002Frubygems.org\u002F). It is strongly\nrecommended that your environment support running `gem install` without\nrequiring root user privileges via `sudo` or otherwise. Using a Ruby version\nmanager like [`rbenv`](https:\u002F\u002Fgithub.com\u002Frbenv\u002Frbenv\u002F) or\n[`rvm`](https:\u002F\u002Frvm.io\u002F) is recommended.\n\nOnce you have an environment that allows you to install gems without `sudo`,\nrun:\n\n```bash\ngem install overcommit\n```\n\nYou can then run the `overcommit` command to install hooks into repositories.\n\n```bash\nmkdir important-project\ncd important-project\ngit init\novercommit --install\n```\n\nAfter running `overcommit --install`, any existing hooks for your repository\nwhich Overcommit will replace will be backed up. You can restore everything to\nthe way it was by running `overcommit --uninstall`.\n\n### Automatically Install Overcommit Hooks\n\nIf you want to use `overcommit` for all repositories you create\u002Fclone going\nforward, add the following to automatically run in your shell environment:\n\n```bash\nexport GIT_TEMPLATE_DIR=\"$(overcommit --template-dir)\"\n```\n\nThe `GIT_TEMPLATE_DIR` provides a directory for Git to use as a template\nfor automatically populating the `.git` directory. If you have your own\ntemplate directory, you might just want to copy the contents of\n`overcommit --template-dir` to that directory.\n\n## Usage\n\nOnce you've installed the hooks via `overcommit --install`, they will\nautomatically run when the appropriate hook is triggered.\n\nThe `overcommit` executable supports the following command-line flags:\n\nCommand Line Flag         | Description\n--------------------------|----------------------------------------------------\n`-i`\u002F`--install`          | Install Overcommit hooks in a repository\n`-u`\u002F`--uninstall`        | Remove Overcommit hooks from a repository\n`-f`\u002F`--force`            | Don't bail on install if other hooks already exist--overwrite them\n`-l`\u002F`--list-hooks`       | Display all available hooks in the current repository\n`-r`\u002F`--run`              | Run pre-commit hook against all tracked files in repository\n`--diff \u003Cref>`            | Run pre-commit hook against all changed files relative to `\u003Cref>`\n`-t`\u002F`--template-dir`     | Print location of template directory\n`-h`\u002F`--help`             | Show command-line flag documentation\n`-v`\u002F`--version`          | Show version\n\n### Skipping Hooks\n\nSometimes a hook will report an error that for one reason or another you'll want\nto ignore. To prevent these errors from blocking your commit, you can include\nthe name of the relevant hook in the `SKIP` environment variable, e.g.\n\n```bash\nSKIP=RuboCop git commit\n```\n\nIf you would prefer to specify a whitelist of hooks rather than a blacklist, use\nthe `ONLY` environment variable instead.\n\n```bash\nONLY=RuboCop git commit\n```\n\nUse this feature sparingly, as there is no point to having the hook in the first\nplace if you're just going to ignore it. If you want to ensure a hook is never\nskipped, set the `required` option to `true` in its configuration. If you\nattempt to skip it, you'll see a warning telling you that the hook is required,\nand the hook will still run.\n\n### Disabling Overcommit\n\nIf you have scripts that execute `git` commands where you don't want Overcommit\nhooks to run, you can disable Overcommit entirely by setting the\n`OVERCOMMIT_DISABLE` environment variable.\n\n```bash\nOVERCOMMIT_DISABLE=1 .\u002Fmy-custom-script\n```\n\n### Disabling Colorized Output\n\nOvercommit automatically colorizes its output based on whether it is outputting\nto a TTY. However, you can manually enable\u002Fdisable color by setting the\n`OVERCOMMIT_COLOR` environment variable.\n\n```bash\nOVERCOMMIT_COLOR=0 git commit\n```\n\n## Continuous Integration\n\nYou can run the same set of hooks that would be executed in a pre-commit hook\nagainst your entire repository by running `overcommit --run`. This makes it\neasy to have the checks verified by a CI service such as\n[Travis CI](https:\u002F\u002Ftravis-ci.com\u002F), including custom hooks you've written\nyourself.\n\nThe `--run` flag works by creating a pre-commit context that assumes _all_ the\nfiles in your repository have changed, and follows the same rules as a normal\npre-commit check. If any hook fails with an error, it will return a non-zero\nexit code.\n\n## Configuration\n\nOvercommit provides a flexible configuration system that allows you to tailor\nthe built-in hooks to suit your workflow. All configuration specific to a\nrepository is stored in `.overcommit.yml` in the top-level directory of the\nrepository.\n\nWhen writing your own configuration, it will automatically extend the\n[default configuration](config\u002Fdefault.yml), so you only need to specify\nyour configuration with respect to the default. In order to\nenable\u002Fdisable hooks, you can add the following to your repo-specific\nconfiguration file:\n\n```yaml\nPreCommit:\n  RuboCop:\n    enabled: true\n    command: ['bundle', 'exec', 'rubocop'] # Invoke within Bundler context\n```\n\nAdditionally, you may wish to have repo-specific configurations that are local to your computer that are not part of the shared repo config.\nAdding a `.local-overcommit.yml` file in the top-level directory of the repository adds another configuration file. This file works the same as `.overcommit.yml`.\nAdding this to ignored files in a git repo will allow you to have a local configuration per repo.\n\n### Hook Options\n\nIndividual hooks expose both built-in configuration options as well as their\nown custom options unique to each hook. The following table lists all built-in\nconfiguration options:\n\nOption                                  | Description\n----------------------------------------|--------------------------------------\n`enabled`                               | If `false`, this hook will never be run\n`required`                              | If `true`, this hook cannot be skipped via the `SKIP` environment variable\n`quiet`                                 | If `true`, this hook does not display any output unless it warns\u002Ffails\n`description`                           | Message displayed while hook is running.\n`requires_files`                        | If `true`, this hook runs only if files that are applicable to it have been modified. See `include` and `exclude` for how to specify applicable files.\n`include`                               | File paths or glob patterns of files that apply to this hook. The hook will only run on the applicable files when they have been modified. Note that the concept of modified varies for different types of hooks. By default, `include` matches every file until you specify a list of patterns.\n`exclude`                               | File paths or glob patterns of files that do not apply to this hook. This is used to exclude any files that would have been matched by `include`.\n`exclude_branches`                      | List of branch names or glob patterns of branches that this hook should not run against.\n`exclude_remotes`                       | *`PrePush` hooks only.* List of remote names that the hook should not run against.\n`include_remote_ref_deletions`          | *`PrePush` hooks only.* By default, `PrePush` hooks will **not** run for pushes that delete a remote ref (i.e. branches or tags). Set to `true` to have the hook run even for deleted remote ref.\n`problem_on_unmodified_line`            | How to treat errors reported on lines that weren't modified during the action captured by this hook (e.g. for pre-commit hooks, warnings\u002Ferrors reported on lines that were not staged with `git add` may not be warnings\u002Ferrors you care about). Valid values are `report`: report errors\u002Fwarnings as-is regardless of line location (default); `warn`: report errors as warnings if they are on lines you didn't modify; and `ignore`: don't display errors\u002Fwarnings at all if they are on lines you didn't modify (`ignore` is _not_ recommended).\n`on_fail`                               | Change the status of a failed hook to `warn` or `pass`. This allows you to treat failures as warnings or potentially ignore them entirely, but you should use caution when doing so as you might be hiding important information.\n`on_warn`                               | Similar to `on_fail`, change the status of a hook that returns a warning status to either `pass` (you wish to silence warnings entirely) or `fail` (you wish to treat all warnings as errors).\n`required_executable`                   | Name of an executable that must exist in order for the hook to run. If this is a path (e.g. `.\u002Fbin\u002Fruby`), ensures that the executable file exists at the given location relative to the repository root. Otherwise, if it just the name of an executable (e.g. `ruby`) checks if the executable can be found in one of the directories in the `PATH` environment variable. Set this to a specific path if you want to always use an executable that is stored in your repository. (e.g. RubyGems bin stubs, Node.js binaries, etc.)\n`required_library`\u002F`required_libraries` | List of Ruby libraries to load with `Kernel.require` before the hook runs. This is specifically for hooks that integrate with external Ruby libraries.\n`command`                               | Array of arguments to use as the command. How each hook uses this is different, but it allows hooks to change the context with which they run. For example, you can change the command to be `['bundle', 'exec', 'rubocop']` instead of just `rubocop` so that you can use the gem versions specified in your local `Gemfile.lock`. This defaults to the name of the `required_executable`.\n`flags`                                 | Array of arguments to append to the `command`. This is useful for customizing the behavior of a tool. It's also useful when a newer version of a tool removes\u002Frenames existing flags, so you can update the flags via your `.overcommit.yml` instead of waiting for an upstream fix in Overcommit.\n`env`                                   | Hash of environment variables the hook should be run with. This is intended to be used as a last resort when an executable a hook runs is configured only via an environment variable. Any pre-existing environment variables with the same names as ones defined in `env` will have their original values restored after the hook runs. **NOTE:** Currently, only strings are accepted values. Boolean values will raise an error. **WARNING**: If you set the same environment variable for multiple hooks and you've enabled parallel hook runs, since the environment is shared across all threads you could accidentally have these separate hooks trample on each other. In this case, you should disable parallelization for the hook using the `parallelize` option.\n`parallelize`                           | Whether to allow this hook to be run concurrently with other hooks. Disable this if the hook requires access to a shared resource that other hooks may also access and modify (e.g. files, the git index, process environment variables, etc).\n`processors`                            | The number of processing units to reserve for this hook. This does not reserve CPUs, but indicates that out of the total number of possible concurrent hooks allowed by the global `concurrency` option, this hook requires the specified number. Thus in the typical case where `concurrency` is set to the number of available cores (default), and you have a hook that executes an application which itself creates 2 threads (or is otherwise scheduled on 2 cores), you can indicate that Overcommit should allocate 2 `processors` to the hook. Ideally this means your hooks won't put undue load on your available cores.\n`install_command`                       | Command the user can run to install the `required_executable` (or alternately the specified `required_libraries`). This is intended for documentation purposes, as Overcommit does not install software on your behalf since there are too many edge cases where such behavior would result in incorrectly configured installations (e.g. installing a Python package in the global package space instead of in a virtual environment).\n`skip_file_checkout`                    | Whether to skip this hook for file checkouts (e.g. `git checkout some-ref -- file`). Only applicable to `PostCheckout` hooks.\n`skip_if`                               | Array of arguments to be executed to determine whether or not the hook should run. For example, setting this to a value of `['bash', '-c', '! which my-executable']` would allow you to skip running this hook if `my-executable` was not in the bin path.\n\nIn addition to the built-in configuration options, each hook can expose its\nown unique configuration options. The `AuthorEmail` hook, for example, allows\nyou to customize the regex used to check commit author emails via the `pattern`\noption&mdash;useful if you want to enforce that developers use a company\nemail address for their commits. This provides incredible flexibility for hook\nauthors as you can make your hooks sufficiently generic and then customize them\non a per-project basis.\n\n### Hook Categories\n\nHook configurations are organized into categories based on the type of hook. So\n`pre-commit` hooks are located under the `PreCommit` option, and `post-commit`\nhooks are located under `PostCommit`. See the\n[default configuration](config\u002Fdefault.yml) for a thorough example.\n\n#### The `ALL` Hook\n\nWithin a hook category, there is a special type of hook configuration that\napplies to _all_ hooks in the category. This configuration looks like a normal\nhook configuration, except it has the name `ALL`:\n\n```yaml\nPreCommit:\n  ALL:\n    problem_on_unmodified_line: warn\n    requires_files: true\n    required: false\n    quiet: false\n\n  SomeHook:\n    enabled: true\n\n  ...\n```\n\nThe `ALL` configuration is useful for when you want to\n[DRY](http:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FDon%27t_repeat_yourself) up your\nconfiguration, or when you want to apply changes across an entire category of\nhooks.\n\nNote that array configuration options (like `include`\u002F`exclude`) in the\nspecial `ALL` hook section are not merged with individual hook configurations\nif custom ones are defined for the hook.\nAny custom configuration option for `include`\u002F`exclude` will replace the `ALL`\nhook's configuration. If you want to have a global list of default exclusions\nand extend them with a custom list, you can use YAML references, e.g.\n\n```yaml\nPreCommit:\n  ALL:\n    exclude: &default_excludes\n      - 'node_modules\u002F**\u002F*'\n      - 'vendor\u002F**\u002F*'\n  MyHook:\n    exclude:\n      - *default_excludes\n      - 'another\u002Fdirectory\u002Fin\u002Faddition\u002Fto\u002Fdefault\u002Fexcludes\u002F**\u002F*'\n```\n\nAgain, you can consult the [default configuration](config\u002Fdefault.yml) for\ndetailed examples of how the `ALL` hook can be used.\n\n### Gemfile\n\nYou may want to enforce the version of Overcommit or other gems that you use in\nyour git hooks. This can be done by specifying the `gemfile` option in your\n`.overcommit.yml`.\n\nThe `gemfile` option tells Overcommit to load the specified file with\n[Bundler](http:\u002F\u002Fbundler.io\u002F), the standard gem dependency manager for Ruby.\nThis is useful if you would like to:\n\n  - Enforce a specific version of Overcommit to use for all hook runs\n    (or to use a version from the master branch that has not been released yet)\n  - Enforce a specific version or unreleased branch is used for a gem you want\n    to use in your git hooks\n\nLoading a Bundler context necessarily adds a startup delay to your hook runs\nas Bundler parses the specified `Gemfile` and checks that the dependencies are\nsatisfied. Thus for projects with many gems this can introduce a noticeable\ndelay.\n\nThe recommended workaround is to create a separate `Gemfile` in the root of\nyour repository (call it `.overcommit_gems.rb`), and include only the gems that\nyour Overcommit hooks need in order to run. Generate the associated lock file\nby running:\n\n```bash\nbundle install --gemfile=.overcommit_gems.rb\n```\n\n...and commit `.overcommit_gems.rb` and the resulting\n`.overcommit_gems.rb.lock` file to your repository. Set your `gemfile` option\nto `.overcommit_gems.rb`, and you're all set.\n\nUsing a smaller Gemfile containing only the gems used by your Overcommit hooks\nsignificantly reduces the startup delay in your hook runs. It is thus the\nrecommended approach unless your project has a relatively small number of gems\nin your `Gemfile`.\n\n### Plugin Directory\n\nYou can change the directory that project-specific hooks are loaded from via\nthe `plugin_directory` option. The default directory is `.git-hooks`.\n\n### Quiet Hook Runs\n\nIf you prefer to have your hooks be completely silent unless there is a\nproblem, you can set the top-level `quiet` option to `true`. Note that if you\nhave many hooks or slow hooks this may not be desirable, as you don't get\nvisual feedback indicating the general progress of the hook run.\n\n### Concurrency\n\nOvercommit runs hooks in parallel by default, with a number of concurrent\nworkers equal to the number of logical cores on your machine. If you know your\nparticular set of hooks would benefit from higher\u002Flower number of workers, you\ncan adjust the global `concurrency` option. You can define single-operator\nmathematical expressions, e.g. `%{processors} * 2`, or `%{processors} \u002F 2`.\n\n```yaml\nconcurrency: '%{processors} \u002F 4'\n```\n\nNote that individual hooks can specify the number of processors they require\nwith the `processors` hook option. See the [hook options](#hook-options)\nsection for more details.\n\n### Signature Verification\n\nYou can disable manual verification of signatures by setting\n`verify_signatures` to `false`. See the [Security](#security) section for more\ninformation on this option and what exactly it controls.\n\n## Built-In Hooks\n\nCurrently, Overcommit supports the following hooks out of the box&mdash;simply\nenable them in your `.overcommit.yml`.\n\n**Note**: Hooks with a `*` are enabled by default.\n\n**Warning**: This list represents the list of hooks available on the `master`\nbranch. Please consult the [change log](CHANGELOG.md) to view which hooks have\nnot been released yet.\n\n### CommitMsg\n\n`commit-msg` hooks are run against every commit message you write before a\ncommit is created. A failed hook prevents a commit from being created. These\nhooks are useful for enforcing policies on your commit messages, e.g. ensuring\na task ID is included for tracking purposes, or ensuring your commit messages\nfollow [proper formatting guidelines](http:\u002F\u002Ftbaggery.com\u002F2008\u002F04\u002F19\u002Fa-note-about-git-commit-messages.html).\n\n* [`*`CapitalizedSubject](lib\u002Fovercommit\u002Fhook\u002Fcommit_msg\u002Fcapitalized_subject.rb)\n* [`*`EmptyMessage](lib\u002Fovercommit\u002Fhook\u002Fcommit_msg\u002Fempty_message.rb)\n* [GerritChangeId](lib\u002Fovercommit\u002Fhook\u002Fcommit_msg\u002Fgerrit_change_id.rb)\n* [HardTabs](lib\u002Fovercommit\u002Fhook\u002Fcommit_msg\u002Fhard_tabs.rb)\n* [MessageFormat](lib\u002Fovercommit\u002Fhook\u002Fcommit_msg\u002Fmessage_format.rb)\n* [RussianNovel](lib\u002Fovercommit\u002Fhook\u002Fcommit_msg\u002Frussian_novel.rb)\n* [`*`SingleLineSubject](lib\u002Fovercommit\u002Fhook\u002Fcommit_msg\u002Fsingle_line_subject.rb)\n* [SpellCheck](lib\u002Fovercommit\u002Fhook\u002Fcommit_msg\u002Fspell_check.rb)\n* [`*`TextWidth](lib\u002Fovercommit\u002Fhook\u002Fcommit_msg\u002Ftext_width.rb)\n* [`*`TrailingPeriod](lib\u002Fovercommit\u002Fhook\u002Fcommit_msg\u002Ftrailing_period.rb)\n\n### PostCheckout\n\n`post-checkout` hooks run after a successful `git checkout`, or in other words\nany time your `HEAD` changes or a file is explicitly checked out.\n\n* [BowerInstall](lib\u002Fovercommit\u002Fhook\u002Fpost_checkout\u002Fbower_install.rb)\n* [BundleInstall](lib\u002Fovercommit\u002Fhook\u002Fpost_checkout\u002Fbundle_install.rb)\n* [ComposerInstall](lib\u002Fovercommit\u002Fhook\u002Fpost_checkout\u002Fcomposer_install.rb)\n* [IndexTags](lib\u002Fovercommit\u002Fhook\u002Fpost_checkout\u002Findex_tags.rb)\n* [NpmInstall](lib\u002Fovercommit\u002Fhook\u002Fpost_checkout\u002Fnpm_install.rb)\n* [SubmoduleStatus](lib\u002Fovercommit\u002Fhook\u002Fpost_checkout\u002Fsubmodule_status.rb)\n* [YarnInstall](lib\u002Fovercommit\u002Fhook\u002Fpost_checkout\u002Fyarn_install.rb)\n\n### PostCommit\n\n`post-commit` hooks run after a commit is successfully created. A hook failing\nin this case does not prevent the commit since it has already occurred;\nhowever, it can be used to alert the user to some issue.\n\n* [BowerInstall](lib\u002Fovercommit\u002Fhook\u002Fpost_commit\u002Fbower_install.rb)\n* [BundleInstall](lib\u002Fovercommit\u002Fhook\u002Fpost_commit\u002Fbundle_install.rb)\n* [Commitplease](lib\u002Fovercommit\u002Fhook\u002Fpost_commit\u002Fcommitplease.rb)\n* [ComposerInstall](lib\u002Fovercommit\u002Fhook\u002Fpost_commit\u002Fcomposer_install.rb)\n* [GitGuilt](lib\u002Fovercommit\u002Fhook\u002Fpost_commit\u002Fgit_guilt.rb)\n* [IndexTags](lib\u002Fovercommit\u002Fhook\u002Fpost_commit\u002Findex_tags.rb)\n* [NpmInstall](lib\u002Fovercommit\u002Fhook\u002Fpost_commit\u002Fnpm_install.rb)\n* [SubmoduleStatus](lib\u002Fovercommit\u002Fhook\u002Fpost_commit\u002Fsubmodule_status.rb)\n* [YarnInstall](lib\u002Fovercommit\u002Fhook\u002Fpost_commit\u002Fyarn_install.rb)\n\n### PostMerge\n\n`post-merge` hooks run after a `git merge` executes successfully with no merge\nconflicts. A hook failing in this case does not prevent the merge since it has\nalready occurred; however, it can be used to alert the user to some issue.\n\n* [BowerInstall](lib\u002Fovercommit\u002Fhook\u002Fpost_merge\u002Fbower_install.rb)\n* [BundleInstall](lib\u002Fovercommit\u002Fhook\u002Fpost_merge\u002Fbundle_install.rb)\n* [ComposerInstall](lib\u002Fovercommit\u002Fhook\u002Fpost_merge\u002Fcomposer_install.rb)\n* [IndexTags](lib\u002Fovercommit\u002Fhook\u002Fpost_merge\u002Findex_tags.rb)\n* [NpmInstall](lib\u002Fovercommit\u002Fhook\u002Fpost_merge\u002Fnpm_install.rb)\n* [SubmoduleStatus](lib\u002Fovercommit\u002Fhook\u002Fpost_merge\u002Fsubmodule_status.rb)\n* [YarnInstall](lib\u002Fovercommit\u002Fhook\u002Fpost_merge\u002Fyarn_install.rb)\n\n### PostRewrite\n\n`post-rewrite` hooks run after a commit is modified by a `git commit --amend`\nor `git rebase`. A hook failing in this case does not prevent the rewrite since\nit has already occurred; however, it can be used to alert the user to some\nissue.\n\n* [BowerInstall](lib\u002Fovercommit\u002Fhook\u002Fpost_rewrite\u002Fbower_install.rb)\n* [BundleInstall](lib\u002Fovercommit\u002Fhook\u002Fpost_rewrite\u002Fbundle_install.rb)\n* [ComposerInstall](lib\u002Fovercommit\u002Fhook\u002Fpost_rewrite\u002Fcomposer_install.rb)\n* [IndexTags](lib\u002Fovercommit\u002Fhook\u002Fpost_rewrite\u002Findex_tags.rb)\n* [NpmInstall](lib\u002Fovercommit\u002Fhook\u002Fpost_rewrite\u002Fnpm_install.rb)\n* [SubmoduleStatus](lib\u002Fovercommit\u002Fhook\u002Fpost_rewrite\u002Fsubmodule_status.rb)\n* [YarnInstall](lib\u002Fovercommit\u002Fhook\u002Fpost_rewrite\u002Fyarn_install.rb)\n\n### PreCommit\n\n`pre-commit` hooks are run after `git commit` is executed, but before the\ncommit message editor is displayed. If a hook fails, the commit will not be\ncreated. These hooks are ideal for syntax checkers, linters, and other checks\nthat you want to run before you allow a commit to even be created.\n\n#### WARNING: pre-commit hooks cannot have side effects\n\n`pre-commit` hooks currently do not support hooks with side effects (such as\nmodifying files and adding them to the index with `git add`). This is a\nconsequence of Overcommit's pre-commit hook stashing behavior to ensure hooks\nare run against _only the changes you are about to commit_.\n\nWithout Overcommit, the proper way to write a `pre-commit` hook would be to\nextract the staged changes into temporary files and lint those files\ninstead of whatever contents are in your working tree (as you don't want\nunstaged changes to taint your results). Overcommit takes care\nof this for you, but to do it in a generalized way introduces this\nlimitation. See the [thread tracking this\nissue](https:\u002F\u002Fgithub.com\u002Fsds\u002Fovercommit\u002Fissues\u002F238) for more details.\n\n* [`*`AuthorEmail](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fauthor_email.rb)\n* [`*`AuthorName](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fauthor_name.rb)\n* [BerksfileCheck](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fberksfile_check.rb)\n* [`*`BrokenSymlinks](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fbroken_symlinks.rb)\n* [BundleAudit](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fbundle_audit.rb)\n* [BundleCheck](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fbundle_check.rb)\n* [BundleOutdated](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fbundle_outdated.rb)\n* [`*`CaseConflicts](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fcase_conflicts.rb)\n* [ChamberSecurity](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fchamber_security.rb)\n* [CodeSpellCheck](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fcode_spell_check.rb)\n* [CoffeeLint](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fcoffee_lint.rb)\n* [Credo](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fcredo.rb)\n* [CssLint](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fcss_lint.rb)\n* [DartAnalyzer](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fdart_analyzer.rb)\n* [Dogma](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fdogma.rb)\n* [ErbLint](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Ferb_lint.rb)\n* [EsLint](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fes_lint.rb)\n* [ExecutePermissions](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fexecute_permissions.rb)\n* [Fasterer](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Ffasterer.rb)\n* [FileSize](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Ffile_size.rb)\n* [FixMe](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Ffix_me.rb)\n* [Flay](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fflay.rb)\n* [Foodcritic](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Ffoodcritic.rb)\n* [ForbiddenBranches](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fforbidden_branches.rb)\n* [GoLint](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fgo_lint.rb)\n* [GoVet](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fgo_vet.rb)\n* [Hadolint](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fhadolint.rb)\n* [LicenseFinder](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Flicense_finder.rb)\n* [HamlLint](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fhaml_lint.rb)\n* [HardTabs](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fhard_tabs.rb)\n* [Hlint](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fhlint.rb)\n* [HtmlHint](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fhtml_hint.rb)\n* [HtmlTidy](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fhtml_tidy.rb)\n* [ImageOptim](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fimage_optim.rb)\n* [JavaCheckstyle](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fjava_checkstyle.rb)\n* [Jscs](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fjscs.rb)\n* [JsHint](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fjs_hint.rb)\n* [JsLint](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fjs_lint.rb)\n* [Jsl](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fjsl.rb)\n* [JsonSyntax](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fjson_syntax.rb)\n* [KtLint](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fkt_lint.rb)\n* [LicenseHeader](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Flicense_header.rb)\n* [LineEndings](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fline_endings.rb)\n* [LocalPathsInGemfile](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Flocal_paths_in_gemfile.rb)\n* [Mdl](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fmdl.rb)\n* [`*`MergeConflicts](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fmerge_conflicts.rb)\n* [NginxTest](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fnginx_test.rb)\n* [PhpCs](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fphp_cs.rb)\n* [PhpCsFixer](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fphp_cs_fixer.rb)\n* [PhpLint](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fphp_lint.rb)\n* [PhpStan](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fphp_stan.rb)\n* [Pronto](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fpronto.rb)\n* [PuppetLint](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fpuppet_lint.rb)\n* [PuppetMetadataJsonLint](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fpuppet_metadata_json_lint.rb)\n* [Pycodestyle](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fpycodestyle.rb)\n* [Pydocstyle](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fpydocstyle.rb)\n* [Pyflakes](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fpyflakes.rb)\n* [Pylint](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fpylint.rb)\n* [PythonFlake8](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fpython_flake8.rb)\n* [RakeTarget](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Frake_target.rb)\n* [RailsBestPractices](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Frails_best_practices.rb)\n* [RailsSchemaUpToDate](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Frails_schema_up_to_date.rb)\n* [Reek](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Freek.rb)\n* [RuboCop](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Frubo_cop.rb)\n* [RubyLint](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fruby_lint.rb)\n* [RubySyntax](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fruby_syntax.rb)\n* [SwiftLint](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fswift_lint.rb)\n* [Scalariform](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fscalariform.rb)\n* [Scalastyle](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fscalastyle.rb)\n* [ScssLint](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fscss_lint.rb)\n* [SemiStandard](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fsemi_standard.rb)\n* [ShellCheck](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fshell_check.rb)\n* [SlimLint](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fslim_lint.rb)\n* [Sorbet](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fsorbet.rb)\n* [Sqlint](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fsqlint.rb)\n* [Standard](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fstandard.rb)\n* [Stylelint](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fstylelint.rb)\n* [TrailingWhitespace](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Ftrailing_whitespace.rb)\n* [TravisLint](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Ftravis_lint.rb)\n* [TsLint](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fts_lint.rb)\n* [Vint](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fvint.rb)\n* [W3cCss](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fw3c_css.rb)\n* [W3cHtml](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fw3c_html.rb)\n* [XmlLint](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fxml_lint.rb)\n* [XmlSyntax](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fxml_syntax.rb)\n* [YamlLint](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fyaml_lint.rb)\n* [YamlSyntax](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fyaml_syntax.rb)\n* [YardCoverage](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fyard_coverage.rb)\n* [YarnCheck](lib\u002Fovercommit\u002Fhook\u002Fpre_commit\u002Fyarn_check.rb)\n\n### PrePush\n\n`pre-push` hooks are run during `git push`, after remote refs have been updated\nbut before any objects have been transferred. If a hook fails, the push is\naborted.\n\n* [Brakeman](lib\u002Fovercommit\u002Fhook\u002Fpre_push\u002Fbrakeman.rb)\n* [FlutterTest](lib\u002Fovercommit\u002Fhook\u002Fpre_push\u002Fflutter_test.rb)\n* [Minitest](lib\u002Fovercommit\u002Fhook\u002Fpre_push\u002Fminitest.rb)\n* [PhpUnit](lib\u002Fovercommit\u002Fhook\u002Fpre_push\u002Fphp_unit.rb)\n* [Pronto](lib\u002Fovercommit\u002Fhook\u002Fpre_push\u002Fpronto.rb)\n* [ProtectedBranches](lib\u002Fovercommit\u002Fhook\u002Fpre_push\u002Fprotected_branches.rb)\n* [PubTest](lib\u002Fovercommit\u002Fhook\u002Fpre_push\u002Fpub_test.rb)\n* [Pytest](lib\u002Fovercommit\u002Fhook\u002Fpre_push\u002Fpytest.rb)\n* [PythonNose](lib\u002Fovercommit\u002Fhook\u002Fpre_push\u002Fpython_nose.rb)\n* [RakeTarget](lib\u002Fovercommit\u002Fhook\u002Fpre_push\u002Frake_target.rb)\n* [RSpec](lib\u002Fovercommit\u002Fhook\u002Fpre_push\u002Fr_spec.rb)\n* [TestUnit](lib\u002Fovercommit\u002Fhook\u002Fpre_push\u002Ftest_unit.rb)\n\n### PreRebase\n\n`pre-rebase` hooks are run during `git rebase`, before any commits are rebased.\nIf a hook fails, the rebase is aborted.\n\n* [MergedCommits](lib\u002Fovercommit\u002Fhook\u002Fpre_rebase\u002Fmerged_commits.rb)\n\n## Repo-Specific hooks\n\nOut of the box, `overcommit` comes with a set of hooks that enforce a variety of\nstyles and lints. However, some hooks only make sense in the context of a\nspecific repository.\n\nFor example, you can have a number of simple checks that run\nagainst your code to catch common errors. For example, if you use\n[RSpec](http:\u002F\u002Frspec.info\u002F), you can make sure all spec files contain the\nline `require 'spec_helper'`.\n\nInside our repository, we can add the file\n`.git-hooks\u002Fpre_commit\u002Fensure_spec_helper.rb` in order to automatically check\nour spec files:\n\n```ruby\nmodule Overcommit::Hook::PreCommit\n  class EnsureSpecHelper \u003C Base\n    def run\n      errors = []\n\n      applicable_files.each do |file|\n        if File.read(file) !~ \u002F^require 'spec_helper'\u002F\n          errors \u003C\u003C \"#{file}: missing `require 'spec_helper'`\"\n        end\n      end\n\n      return :fail, errors.join(\"\\n\") if errors.any?\n\n      :pass\n    end\n  end\nend\n```\n\nThe corresponding configuration for this hook would look like:\n\n```yaml\nPreCommit:\n  EnsureSpecHelper:\n    enabled: true\n    description: 'Checking for missing inclusion of spec_helper'\n    include: '**\u002F*_spec.rb'\n```\n\n### Adding Existing Git Hooks\n\nYou might already have hook scripts written which you'd like to integrate with\nOvercommit right away. To make this easy, Overcommit allows you to include\nyour hook script in your configuration without writing any Ruby code.\nFor example:\n\n```yaml\nPostCheckout:\n  CustomScript:\n    enabled: true\n    required_executable: '.\u002Fbin\u002Fcustom-script'\n```\n\nSo long as a command is given (either by specifying the `command` option\ndirectly or specifying `required_executable`) a special hook is created that\nexecutes the command and appends any arguments and standard input stream that\nwould have been passed to the regular hook. The hook passes or fails based\non the exit status of the command.\n\nThe script is executed as if Git were calling the hook directly. If you want\nto understand which arguments are passed to the script depending on the type\nof hook, see the [git-hooks documentation][GHD].\n\n[GHD]: https:\u002F\u002Fgit-scm.com\u002Fbook\u002Fen\u002Fv2\u002FCustomizing-Git-Git-Hooks\n\n## Security\n\nWhile Overcommit can make managing Git hooks easier and more convenient,\nthis convenience can come at a cost of being less secure.\n\nSince installing Overcommit hooks will allow arbitrary plugin code in your\nrepository to be executed, you expose yourself to an attack where checking\nout code from a third party can result in malicious code being executed\non your system.\n\nAs an example, consider the situation where you have an open source project.\nAn attacker could submit a pull request which adds a `post-checkout` hook\nthat executes some malicious code. When you fetch and checkout this pull\nrequest, the `post-checkout` hook will be run on your machine, along with\nthe malicious code that you just checked out.\n\nOvercommit attempts to address this problem by storing a signature of your\nconfiguration and all hook plugin code since the last time it ran. When the\nsignature changes, a warning is displayed alerting you to which plugins have\nchanged. It is then up to you to manually verify that the changes are not\nmalicious, and then continue running the hooks.\n\nThe signature is derived from the contents of the plugin's source code itself\nand any configuration for the plugin. Thus a change to the plugin's source\ncode or your local repo's `.overcommit.yml` file could result in a signature\nchange.\n\n### Disabling Signature Checking\n\nIn typical usage, your plugins usually don't change too often, so this warning\nshouldn't become a nuisance. However, users who work within proprietary\nrepositories where all developers who can push changes to the repository\nalready have a minimum security clearance may wish to disable this check.\n\nWhile not recommended, you can disable signature verification by setting\n`verify_signatures` to `false` in your `.overcommit.yml` file.\n\n**Regardless of whether you have `verify_signatures` disabled for your project,\nif you are running Overcommit for the first time you will need to sign your\nconfiguration with `overcommit --sign`**. This needs to happen once so\nOvercommit can record in your local git repo's configuration (outside of source\ncontrol) that you intend to enable\u002Fdisable verification. This way if someone\nelse changes `verify_signatures` you'll be asked to confirm the change.\n\n## Contributing\n\nWe love contributions to Overcommit, be they bug reports, feature ideas, or\npull requests. See our [guidelines for contributing](CONTRIBUTING.md) to best\nensure your thoughts, ideas, or code get merged.\n\n## Community\n\nAll major discussion surrounding Overcommit happens on the\n[GitHub issues list](https:\u002F\u002Fgithub.com\u002Fsds\u002Fovercommit\u002Fissues).\n\n## Changelog\n\nIf you're interested in seeing the changes and bug fixes between each version\nof `overcommit`, read the [Overcommit Changelog](CHANGELOG.md).\n\n## License\n\nThis project is released under the [MIT license](MIT-LICENSE).\n\nThe Overcommit logo is adapted from the [Git Logo by Jason Long][GL], and\nis licensed under the [Creative Commons Attribution 3.0 Unported License][CC3].\n\n[GL]: https:\u002F\u002Fgit-scm.com\u002Fdownloads\u002Flogos\n[CC3]: http:\u002F\u002Fcreativecommons.org\u002Flicenses\u002Fby\u002F3.0\u002F\n","overcommit 是一个用于管理和配置 Git 钩子的工具。它支持多种钩子，可以跨多个仓库使用，同时也允许为特定仓库定义并存储在源代码控制中的钩子，无需编写任何 Ruby 代码即可轻松添加现有的钩子脚本。其技术特点包括广泛的可配置性、对多种语言和文件格式的支持以及良好的扩展性。适用于需要自动化执行代码检查、格式化等任务的开发团队或个人开发者，在提交代码前后自动运行预设的测试或验证逻辑，从而提高代码质量和开发效率。",2,"2026-06-11 03:14:25","top_language"]