{"id":34609452,"url":"https://github.com/bthuilot/ggh","last_synced_at":"2026-05-24T20:07:29.353Z","repository":{"id":277866450,"uuid":"904188159","full_name":"bthuilot/ggh","owner":"bthuilot","description":"global git hooks","archived":false,"fork":false,"pushed_at":"2025-07-23T12:09:54.000Z","size":111,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-23T13:26:03.685Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"OCaml","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bthuilot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-12-16T12:16:07.000Z","updated_at":"2025-07-23T12:09:59.000Z","dependencies_parsed_at":"2025-04-22T17:41:18.365Z","dependency_job_id":"42ddff65-3875-4dbb-a1c4-f10eafb8d102","html_url":"https://github.com/bthuilot/ggh","commit_stats":null,"previous_names":["bthuilot/ggh"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/bthuilot/ggh","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bthuilot%2Fggh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bthuilot%2Fggh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bthuilot%2Fggh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bthuilot%2Fggh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bthuilot","download_url":"https://codeload.github.com/bthuilot/ggh/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bthuilot%2Fggh/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28003721,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-24T02:00:07.193Z","response_time":83,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-12-24T14:01:24.178Z","updated_at":"2026-05-24T20:07:29.346Z","avatar_url":"https://github.com/bthuilot.png","language":"OCaml","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Global Git Hooks\n\nA system-wide git hook configuration for easy, consitant, and personalized configuration.\n\n## Overview\n\nGlobal git hooks provides a way to run various git hooks across your whole system.\nWhile other tools like [pre-commit](https://pre-commit.com/) are designed with collaboration and config sharing in mind,\nggh is not. Easily add personalized hooks to your development enviroment across all your\ngit repositories and aditionally provide projection against running untrusted git hooks.\n\n### Sample hooks\n\nggh ships with 3 pre-defined hooks currently, located in the `hooks` directory\n\n1. `ggh-gitleaks`: runs gitleaks as a pre-commit hook, exiting 1 if a secret is found (requires gitleaks to be installed)\n2. `ggh-conventional-commit`: A commit-msg hook to ensure the message meets the convetional commit standard\n3. `ggh-signed-off`: a commit-msg hook to ensure the message includes a `Signed-off-by` block.\n\nThese programs are optional and can be installed along side `ggh` via `make install-default-hooks`\n\n## Installation\n\n### via Homebrew\n\nIf you have [Homebrew](https://brew.sh) installed,\nyou can install via:\n\n```bash\nbrew tap bthuilot/tap\n\nbrew install bthuilot/tap/ggh\n```\n\n\u003c!-- ### via Archlinux User Repositories --\u003e\n\u003c!-- // TODO --\u003e\n\n### Manual\n\nYou will require [Opam](https://opam.ocaml.org/) to build/compile yourself.\n\n```bash\ngit clone https://github.com/bthuilot/ggh\ncd ggh/\n\nmake\n\n# 'make install' will install the binary\n# to /usr/local/bin/ggh and system-link\n# the binary to /usr/share/ggh/${HOOK_NAME}\n# for each git hook ggh supports.\nsudo make install\n\n# set GGH as your hooks path\ngit config set --global core.hooksPath /usr/share/ggh/\n\n## OPTIONAL ##\n# Install the \"Sample hooks\" listed above\n# to /usr/bin/local/\nsudo make install-default-hooks \n```\n\n*NOTE*: Additionally, [Go](https://go.dev) is used to install development tools and\nis required when contributing.\n\n\n## Configuration\n\nAll configuration for ggh is done using the `.gitconfig` file\nand via the `git config` command. All options should be prefixed by `ggh.`\nsection of your config. Below are the list of options.\n\n| Config key                                          | Description                                                            | Mutliple values?                                                                                                                                                                                                   |\n|-----------------------------------------------------|------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `$HOOK_NAME` (e.g `pre-commit`, `commit-msg`, etc.) | The hooks to execute when the respective hook (`$HOOK_NAME`) is called | yes                                                                                                                                                                                                                |\n| `additionalHooksPath`                               | Additional hooks path to call when executed                            | yes                                                                                                                                                                                                                |\n| `logLevel`                                          | The log level for ggh                                                  | no                                                                                                                                                                                                                 |\n| `defaultPolicyAction`                                      | no                                                                     | The policy of a git directory local hooks when not specified.                                                                                                                                              |\n| `allow`                                             | yes                                                                    | Mark the local hooks in a directory as allowed. If the base of the path is a wildcard (e.g. `/dir/*`) this indicates that directory and all sub directories.                                                       |\n| `deny`                                             | yes                                                                    | Mark the local hooks in a directory as blocked and will not be run. If the base of the path is a wildcard (e.g. `/dir/*`) this indicates that directory and all sub directories.                                   |\n| `confirm`                                               | yes                                                                    | Specify that before running a local hook in the directory, the user should be asked for confirmation. If the base of the path is a wildcard (e.g. `/dir/*`) this indicates that directory and all sub directories. |\n\n\n\n\nYou can also manually edit the gitconfig manually\n\n```gitconfig\n# ~/.gitconfig\n[ggh]\n\t## Hooks ##\n   \t# set pre-commit hooks #\n\tpre-commit = gitleaks \n\n\t# commit-msg hooks #\n\tcommit-msg = ggh-signed-off\n\tcommit-msg = ggh-conventional-commit\n\t## Application config ##\n\n\t## GGH Config ##\n\tlogLevel = debug\n\t\n\t# Additional hooks path to call\n\tadditionalHooksPath = /other/hooks/path/to/call\n\t\n\t## Local hook policy ##\n\t\n\t# Set the default policy action for\n\t# executing local repository hooks when\n\t# a policy is not specified for the directory\n\tdefaultPolicyAction = deny # can be: allow, deny, confirm\n\t\n\t# specify policy per directory.\n\t# A wildcard '*' can be specified at the end to indicate\n\t# sub directories as well.\n\t# If a path is matched in mutliple policies,\n\t# precedence is as follows:\n\t# - if matched in a 'deny', do not run directory hooks\n\t# - if matched in an 'confirm', prompt user before executing\n\t# - if matched in an 'allow', run the directory hooks\n\t# - use default policy action\n\tallow = /home/user/projects/*\n\tallow = /home/user/work/*\n\tconfirm = /home/user/*\n```\n\n\n## Integration with [pre-commit](https://pre-commit.com/)\n\nIntegrating with pre-commit configs shouldn't be affected and should work automtically.\nHowever, when installing pre-commit hooks, pre-commit currently exits if the `core.hooksPath`\nis set (which `ggh` relies on). To get around this, the following command \n\n```bash\nggh pre-commit install\n```\n\nThis will run `pre-commit install` but set the environment variable `GIT_CONFIG=/dev/null` \n(meaning run without reading the users gitconfig)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbthuilot%2Fggh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbthuilot%2Fggh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbthuilot%2Fggh/lists"}