{"id":18514074,"url":"https://github.com/mikhus/.git-hooks","last_synced_at":"2026-05-01T19:32:13.555Z","repository":{"id":137153536,"uuid":"226396170","full_name":"Mikhus/.git-hooks","owner":"Mikhus","description":"Semantic Git Hooks","archived":false,"fork":false,"pushed_at":"2020-12-04T23:30:00.000Z","size":25,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-14T13:19:33.174Z","etag":null,"topics":["git","git-hook","git-hooks","githook","githooks","hook","hooks","semantic","semantic-hook","semantic-hooks","semantic-release","semantic-versioning"],"latest_commit_sha":null,"homepage":null,"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/Mikhus.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-12-06T19:32:29.000Z","updated_at":"2021-04-19T17:39:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"cccf4d1d-43e2-44b5-bbd4-392277a34a22","html_url":"https://github.com/Mikhus/.git-hooks","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/Mikhus/.git-hooks","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mikhus%2F.git-hooks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mikhus%2F.git-hooks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mikhus%2F.git-hooks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mikhus%2F.git-hooks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mikhus","download_url":"https://codeload.github.com/Mikhus/.git-hooks/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mikhus%2F.git-hooks/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32510674,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"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":["git","git-hook","git-hooks","githook","githooks","hook","hooks","semantic","semantic-hook","semantic-hooks","semantic-release","semantic-versioning"],"created_at":"2024-11-06T15:41:55.677Z","updated_at":"2026-05-01T19:32:13.530Z","avatar_url":"https://github.com/Mikhus.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Semantic Git Hooks\n\nThis repository contains implementation of git hooks as pure bash scripts.\nGoal of implemented hooks is to support idea of semantic releases. So it\nrestricts developer from doing meaningless, improper formatted commits. As a\nresult it would allow automate tracking changes just in git and provides\nan ability to automate changelog creation on releases.\n\nCurrently it provides the following hooks:\n\n  - `commit-msg` This hook checks for the correct message format and performs\n    spell-checking of the commit message.\n  - `pre-commit` Verifies that committed changes is correctly spelled\n\nSpell checking is based on external tools. Currently it supports `hunspell` and\n`aspell`. On some systems you may be required to install one of these tools\nmanually.\n\n## Installing\n\nYou may install this repository as a submodule of your repo or simply clone it\nto your repo and remove `.git` directory from the cloned repo:\n\n### Install As Submodule\n\n~~~bash\ncd ./my/project/workdir\ngit submodule add https://github.com/Mikhus/.git-hooks.git\n./.git-hooks/scripts/init\ngit commit -am \"chore: added .git-hooks as submodule to qualify commits\"\ngit push\n~~~\n\nNow anyone would be able to pull `.git-hooks` from your repo. If you want to\nrely on your personal hooks implementation, feel free to fork it and submodule\nfrom your own or organization fork, so you would be able to manage your own\nchanges and still will have possibility to merge from a source repo if needed.\n\nWhen anyone is cloning your repository first, make sure adding `--recursive`\noption to clone command, as:\n\n~~~bash\ngit clone --recursive [your_repo_url]\n~~~\n\n### Installing As Part of Your Repo\n\n~~~bash\ncd ./my/project/workdir\ngit clone git@github.com:Mikhus/.git-hooks.git\nrm -rf .git-hooks/.git\n./.git-hooks/scripts/init\ngit commit -am \"chore: added .git-hooks as submodule to qualify commits\"\ngit push\n~~~\n\nNow you may commit and `.git-hooks` to your project repo to share it between\nteammates.\n\n## Enabling/Disabling\n\nAs simple as:\n\n~~~bash\ncd ./my/project/workdir\n\n# Enabling\n./.git-hooks/scripts/init\n# or, if you want to enable only specific hooks\n./.git-hooks/scripts/init commit-msg\n\n# Disabling\n./.git-hooks/scripts/reset\n~~~\n\nYou may want to automatically enable hooks for everyone in your team. There is\nno other way to do it only by imploding the `init` command, for example in your\ninstall or build tool, so whenever someone will run install or build the hooks\nwill be automatically initialized. For example in your `Makefile`:\n\n~~~Makefile\nSCRIPT_ROOT = .git-hooks/scripts\n\nall: init\n.PHONY: all\n\ninit:\n\t@$(SCRIPT_ROOT)/init\n.PHONY: init\n~~~\n\nOr in your `package.json`\n\n~~~json\n{\n  \"name\": \"my-cool-project\",\n  \"version\": \"1.0.0\",\n  \"scripts\": {\n    \"start\": \"./.git-hooks/scripts/init ; /usr/bin/env node ./index.js\",\n    \"install\": \"./.git-hooks/scripts/init\"\n  }\n}\n~~~\n\nI guess you've caught an idea :)...\n\nOf course it does not give a 100% warranty that improper commits will be \npublished, but that may be achieved only with installing server-side hooks and\nthat option is not always available, so having at least this kind of protection\nis better than nothing.\n\n## Scripts\n\nThis is not only hooks repo. There are couple of other useful scripts delivered\nunder `script` directory\n  \n  - `init/reset` - already described, them are used to disable/enable hooks\n  - `spell` - mostly used to perform spell-checking of the given input. Accepts\n    two arguments - string (or multiline string) input and verification type.\n    Second one is optional, but relies on a git work directory, so will try\n    to find all the places where misspelled words in a current commit diff.\n    With a single argument would treat it as a commit message, but who prevents\n    of using it in other ways, or in another hooks? Examples:\n    ~~~bash\n    ./.git-hooks/scripts/spell \"Wht wng with you?\"\n    ./.git-hooks/scripts/spell \"$(git diff --cached | grep -e \"^+[^+]\")\" \"git\"\n    ~~~\n  - `version` - assumes your git repository uses semantic version tagging\n    for your releases. If so, may help to determine semantic version of\n    current commit or to build the next release version tag, for example:\n    ~~~bash\n    # get current version\n    ./.git-hooks/scripts/version\n    # get next prerelease version\n    ./.git-hooks/scripts/version prerelease\n    # get next patch version\n    ./.git-hooks/scripts/version patch\n    # get next minor version\n    ./.git-hooks/scripts/version minor\n    # get next major version\n    ./.git-hooks/scripts/version major\n    ~~~\n    It is safe to run as it does not modify your repository. This could be \n    useless on NPM based developments, but can be dramatically helpful in many\n    other cases.\n\n## License\n\n[ISC](https://rawgit.com/Mikhus/.git-hooks/master/LICENSE)\n\nHappy Coding!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikhus%2F.git-hooks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmikhus%2F.git-hooks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikhus%2F.git-hooks/lists"}