{"id":13567498,"url":"https://github.com/joelparkerhenderson/git-hooks","last_synced_at":"2026-03-17T23:07:17.890Z","repository":{"id":148893888,"uuid":"255751225","full_name":"joelparkerhenderson/git-hooks","owner":"joelparkerhenderson","description":"Git hooks","archived":false,"fork":false,"pushed_at":"2025-04-14T08:42:08.000Z","size":28,"stargazers_count":8,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-08T12:25:37.821Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/joelparkerhenderson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"joelparkerhenderson","patreon":"joelparkerhenderson","ko_fi":"joelparkerhenderson","custom":["https://paypal.me/joelparkerhenderson"]}},"created_at":"2020-04-14T23:24:17.000Z","updated_at":"2025-04-14T08:42:11.000Z","dependencies_parsed_at":"2025-05-07T05:07:36.432Z","dependency_job_id":"1ca1d0db-d0e1-4cc8-8d2b-e1c7158d46e2","html_url":"https://github.com/joelparkerhenderson/git-hooks","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/joelparkerhenderson/git-hooks","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joelparkerhenderson%2Fgit-hooks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joelparkerhenderson%2Fgit-hooks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joelparkerhenderson%2Fgit-hooks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joelparkerhenderson%2Fgit-hooks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joelparkerhenderson","download_url":"https://codeload.github.com/joelparkerhenderson/git-hooks/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joelparkerhenderson%2Fgit-hooks/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30635156,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-17T22:38:22.569Z","status":"ssl_error","status_checked_at":"2026-03-17T22:38:11.804Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":"2024-08-01T13:02:33.058Z","updated_at":"2026-03-17T23:07:17.874Z","avatar_url":"https://github.com/joelparkerhenderson.png","language":"Shell","funding_links":["https://github.com/sponsors/joelparkerhenderson","https://patreon.com/joelparkerhenderson","https://ko-fi.com/joelparkerhenderson","https://paypal.me/joelparkerhenderson"],"categories":["Shell"],"sub_categories":[],"readme":"# Git hooks\n\nThis repo has example git hooks and helpers.\n\nFor example our git hook named `pre-commit` runs these:\n\n```sh\n.git/hooks/helpers/file-name-must-not-start-with \"tmp\"\n.git/hooks/helpers/file-name-must-not-end-with \".env\"\n.git/hooks/helpers/file-name-must-not-contain \"unversioned\"\n.git/hooks/helpers/file-text-must-end-with-newline\n```\n\nThen runs any scripts in the corresponding directory:\n\n```sh\n.git/hooks/pre-commit.d\n```\n\nThe git hooks print messages such as:\n\n```sh\nFile `tmp/example.txt` name must not start with `tmp`\nFile `environments/example.env` name must not end with `.env`\nFile `vendor/unversioned/example.bin` name must not contain \"unversioned\"\nFile `doc/example.txt` text must end with newline\n```\n\nThe git hooks can use any language, such as this example using POSIX shell:\n\n```sh\n#!/bin/sh\nset -euf\ntarget=\"$1\"\nexit_code=0\n\nfor file_name in $(git diff --cached --name-only); do\n    case \"$file_name\"\n        \"$target\"*)\n            exit_code=1\n            printf %s\\\\n \"File \\`$file_name\\` name must not start with \\`$target\\`.\"\n        ;;\n    esac\ndone\n\nexit $exit_code\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoelparkerhenderson%2Fgit-hooks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoelparkerhenderson%2Fgit-hooks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoelparkerhenderson%2Fgit-hooks/lists"}