{"id":13602955,"url":"https://github.com/tommarshall/git-good-commit","last_synced_at":"2025-04-11T13:32:04.293Z","repository":{"id":10795758,"uuid":"67025830","full_name":"tommarshall/git-good-commit","owner":"tommarshall","description":"Git hook to help you write good commit messages, with no external dependencies.","archived":false,"fork":false,"pushed_at":"2023-05-15T12:24:31.000Z","size":621,"stargazers_count":193,"open_issues_count":11,"forks_count":33,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-08-02T18:43:28.361Z","etag":null,"topics":["best-practices","commit-conventions","commit-message","git","git-hooks","hooks"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tommarshall.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2016-08-31T09:58:26.000Z","updated_at":"2024-05-04T17:11:29.000Z","dependencies_parsed_at":"2022-08-07T06:00:34.562Z","dependency_job_id":null,"html_url":"https://github.com/tommarshall/git-good-commit","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tommarshall%2Fgit-good-commit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tommarshall%2Fgit-good-commit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tommarshall%2Fgit-good-commit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tommarshall%2Fgit-good-commit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tommarshall","download_url":"https://codeload.github.com/tommarshall/git-good-commit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223470339,"owners_count":17150536,"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":["best-practices","commit-conventions","commit-message","git","git-hooks","hooks"],"created_at":"2024-08-01T18:01:44.333Z","updated_at":"2024-11-07T06:30:45.401Z","avatar_url":"https://github.com/tommarshall.png","language":"Shell","readme":"# git-good-commit\n\n[![Build Status](https://travis-ci.org/tommarshall/git-good-commit.svg?branch=master)](https://travis-ci.org/tommarshall/git-good-commit)\n\nGit hook to help you write good commit messages.\n\nValidates commit messages conform to six of [the seven rules of a great git commit message](http://chris.beams.io/posts/git-commit/), plus a couple of extras:\n\n1. [Separate subject from body with a blank line](http://chris.beams.io/posts/git-commit/#separate)\n2. [Limit the subject line to 50 characters](http://chris.beams.io/posts/git-commit/#limit-50)\n3. [Capitalize the subject line](http://chris.beams.io/posts/git-commit/#capitalize)\n4. [Do not end the subject line with a period](http://chris.beams.io/posts/git-commit/#end)\n5. [Use the imperative mood in the subject line](http://chris.beams.io/posts/git-commit/#imperative)\n6. [Wrap the body at 72 characters](http://chris.beams.io/posts/git-commit/#wrap-72)\n7. ~~[Use the body to explain what and why vs. how](http://chris.beams.io/posts/git-commit/#why-not-how)~~ _- you're on your own with this one_\n8. Do no write single worded commits\n9. Do not start the subject line with whitespace\n\nOffers an interactive prompt if any of the rules are detected to be broken.\n\n![git-good-commit animated demo](demo.gif)\n\n## Installation\n\n### Single repository\n\nAt the root of the repository, run:\n\n```sh\ncurl -L https://cdn.rawgit.com/tommarshall/git-good-commit/v0.6.1/hook.sh \u003e .git/hooks/commit-msg \u0026\u0026 chmod +x .git/hooks/commit-msg\n```\n\n### Globally\n\nTo use the hook globally, you can use `git-init`'s template directory:\n\n```sh\nmkdir -p ~/.git-template/hooks\ngit config --global init.templatedir '~/.git-template'\ncurl -L https://cdn.rawgit.com/tommarshall/git-good-commit/v0.6.1/hook.sh \u003e ~/.git-template/hooks/commit-msg \u0026\u0026 chmod +x ~/.git-template/hooks/commit-msg\n```\n\nThe hook will now be present after any `git init` or `git clone`. You can [safely re-run `git init`](http://stackoverflow.com/a/5149861/885540) on any existing repositories to add the hook there.\n\n---\n\n_If you're security conscious, you may be reasonably suspicious of [curling executable files](https://www.seancassidy.me/dont-pipe-to-your-shell.html). In this case you're on HTTPS throughout, and not piping directly to execution, so you can check contents and the hash against MD5 `12fd3b8829eead2eff9a72598cbc9f4b` for v0.6.1._\n\n## Usage\n\n```sh\necho \"apple\" \u003e ./bar.txt\ngit add fruits.txt\n\n# should warn you that the subject line is not capitalised, and offer an interactive prompt.\ngit commit -m 'add fruits.txt'\n```\n\n### Options\n\n```\ne - edit commit message\ny - proceed with commit\nn - abort commit\n? - print help\n```\n\n## Configuration\n\nThe default colour setting is `auto`, but the hook will use `git`'s `color.ui` config setting if defined. You override the colour setting for the hook with:\n\n```\ngit config --global hooks.goodcommit.color \"never\"\n```\n\nSupported values are `always`, `auto`, `never` and `false`.\n\n## Dependencies\n\nNone, other than Bash.\n\n## Credits\n\n* http://chris.beams.io/posts/git-commit\n* http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html\n* https://www.git-scm.com/book/en/v2/Distributed-Git-Contributing-to-a-Project#Commit-Guidelines\n* Tim Perry's excellent [git-confirm](https://github.com/pimterry/git-confirm) hook, which provided the inspiration and much of the scaffolding for this hook.\n","funding_links":[],"categories":["best-practices"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftommarshall%2Fgit-good-commit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftommarshall%2Fgit-good-commit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftommarshall%2Fgit-good-commit/lists"}