{"id":15042472,"url":"https://github.com/cheap-glitch/git-grapnel","last_synced_at":"2026-01-06T18:03:47.739Z","repository":{"id":57686531,"uuid":"299061320","full_name":"cheap-glitch/git-grapnel","owner":"cheap-glitch","description":"🪝 A collection of useful git hooks written in Bash.","archived":false,"fork":false,"pushed_at":"2022-04-09T09:49:09.000Z","size":403,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-01T15:22:35.312Z","etag":null,"topics":["bash-script","bash-scripting","git-automation","git-hooks","hooks","shell-script"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cheap-glitch.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":null,"support":null}},"created_at":"2020-09-27T15:28:57.000Z","updated_at":"2022-04-07T10:00:05.000Z","dependencies_parsed_at":"2022-09-14T07:11:56.463Z","dependency_job_id":null,"html_url":"https://github.com/cheap-glitch/git-grapnel","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheap-glitch%2Fgit-grapnel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheap-glitch%2Fgit-grapnel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheap-glitch%2Fgit-grapnel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cheap-glitch%2Fgit-grapnel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cheap-glitch","download_url":"https://codeload.github.com/cheap-glitch/git-grapnel/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245831807,"owners_count":20679699,"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","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":["bash-script","bash-scripting","git-automation","git-hooks","hooks","shell-script"],"created_at":"2024-09-24T20:47:21.727Z","updated_at":"2026-01-06T18:03:47.733Z","avatar_url":"https://github.com/cheap-glitch.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n\u003cimg src=\"docs/banner-light.png#gh-light-mode-only\" width=\"380\" alt=\"A drawing of a grappling hook, with the word “git-grapnel” under it.\"\u003e\n\u003cimg src=\"docs/banner-dark.png#gh-dark-mode-only\"   width=\"380\" alt=\"A drawing of a grappling hook, with the word “git-grapnel” under it.\"\u003e\n\n\u003cp\u003e\u003c/p\u003e\n\n[![License](https://shields.io/github/license/cheap-glitch/git-grapnel)](LICENSE)\n[![Latest release](https://shields.io/github/v/release/cheap-glitch/git-grapnel?sort=semver\u0026label=latest%20release\u0026color=green)](https://github.com/cheap-glitch/git-grapnel/releases/latest)\n\n\u003c/div\u003e\n\nThis is a collection of custom [git hooks](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks).\n\n## Features\n\n * Automatically lint any modified files before committing\n * Smart spellchecking of commit messages\n * Can enforce the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0) specification\n * …and more!\n\n\u003e Note: even thought  these scripts can be configured to  a certain degree, they\n\u003e can't  possibly cover  all existing  use  cases, and  thus are  meant more  as\n\u003e blueprints and sources of inspiration rather than comprehensive solutions.\n\n## Installation\n\nClone the repo or download the scripts from [the latest release](https://github.com/cheap-glitch/git-grapnel/releases/latest),\nand make sure they're executable (`chmod +x \u003cscripts\u003e`).\n\n### For a single git repo\n\nPlace the scripts in a folder named  `hooks` inside the `.git` directory of that\nrepo.\n\n### For every git repo on a machine\n\nEnsure the scripts are in your `PATH` so that `git` can execute them.\n\nThen  point the  `core.hooksPath` config  option  to the  folder containing  the\nscripts, e.g. if they're stored in `~/.git-grapnel`:\n\n```\ngit config core.hooksPath ~/.git-grapnel\n```\n\n### External dependencies\n\nSome of the scripts  use external tools to accomplish their  tasks, so make sure\nyou install them too:\n * [jq](https://stedolan.github.io/jq) to parse JSON data\n * [aspell](http://aspell.net) to spellcheck commit messages\n\n## Usage\n\nEach  of  the  hooks can  be  bypassed  by  calling  its git  command  with  the\n`--no-verify` option.\n\nAll  the features  are disabled  by  default, and  each  on can  be enabled  and\nconfigured by setting some environment variables (`GIT_GRAPNEL_*`).\n\n### [pre-commit](https://github.com/cheap-glitch/git-grapnel/blob/main/src/pre-commit)\n\nThis hook is run whenever committing to a repo.\n\nSetting `GIT_GRAPNEL_LINT_ON_COMMIT` to `1` will enable the automatic linting of\nmodified source  files. The commit will  be cancelled if any  errors or warnings\nare produced.\n\n### [commit-msg](https://github.com/cheap-glitch/git-grapnel/blob/main/src/commit-msg)\n\nThis hook is run whenever committing to a repo.\n\nSetting  `GIT_GRAPNEL_COMMIT_MSG_FORMAT` to  one  of the  following values  will\nenforce that particular format for commit message:\n * `basic`: the message must start with a capital letter and not end with a full stop\n * `conventional-commits`: the message must conform to the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0) specification\n\nIt can also:\n * spellcheck the commit message and highlight possible typos (`GIT_GRAPNEL_SPELLCHECK`)\n * convert  pairs of  single  quotes (`''`) into  a single  back quote — useful when you\n   surround the message in double quotes on the command line (`GIT_GRAPNEL_CONVERT_SINGLE_QUOTE_PAIRS`)\n * automatically add a corresponding emoji at the start of Conventional Commits messages (`GIT_GRAPNEL_ADD_EMOJIS`)\n\n### [pre-push](https://github.com/cheap-glitch/git-grapnel/blob/main/src/pre-push)\n\nThis hook is run whenever pushing to a remote.\n\nSetting  `GIT_GRAPNEL_PRE_PUSH_CHECKS`  to  `1`   will  automatically  lint  the\ncodebase and  run the testing scripts  present in `package.json`, and  abort the\npush if any of them fail.\n\n### [post-merge](https://github.com/cheap-glitch/git-grapnel/blob/main/src/post-merge)\n\nThis hook is run after a successful merge.\n\nSetting `GIT_GRAPNEL_AUTO_INSTALL`  to `1`  will reinstall  the Node  modules as\nneeded to keep them in sync with `package-lock.json`.\n\n## Contributing\n\nContributions are welcomed! Please open an issue before submitting substantial changes.\n\n## Related\n\n * [The official documentation on Git hooks](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks)\n * [`git-toolbelt`](https://github.com/nvie/git-toolbelt) – A collection of convenient utilities for everyday git usage\n\n## License\n\nISC\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcheap-glitch%2Fgit-grapnel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcheap-glitch%2Fgit-grapnel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcheap-glitch%2Fgit-grapnel/lists"}