{"id":23379417,"url":"https://github.com/log-oscon/git-hooks","last_synced_at":"2025-07-08T08:05:01.957Z","repository":{"id":146347418,"uuid":"221193560","full_name":"log-oscon/git-hooks","owner":"log-oscon","description":null,"archived":false,"fork":false,"pushed_at":"2019-11-13T11:43:59.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-08T06:37:07.860Z","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/log-oscon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-11-12T10:42:27.000Z","updated_at":"2019-11-13T11:44:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"db2bc9db-a86c-4665-968f-fafb84a699f2","html_url":"https://github.com/log-oscon/git-hooks","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/log-oscon/git-hooks","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/log-oscon%2Fgit-hooks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/log-oscon%2Fgit-hooks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/log-oscon%2Fgit-hooks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/log-oscon%2Fgit-hooks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/log-oscon","download_url":"https://codeload.github.com/log-oscon/git-hooks/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/log-oscon%2Fgit-hooks/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264229252,"owners_count":23576239,"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":[],"created_at":"2024-12-21T19:18:34.512Z","updated_at":"2025-07-08T08:05:01.920Z","avatar_url":"https://github.com/log-oscon.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Git hooks\nThis project stores some git hooks that can help streamline working with multiple branches.\n\nPre push hooks were inspired by [Colch's Git pre-push hook](https://gist.github.com/ColCh/9d48693276aac50cac37a9fce23f9bda).\n\n## Available hooks \nCurrently there are the folling hooks available on this repository: \n\n* *prehook-push-denied.sh* - denies push to the branches listed on *no\\_push\\_branches* variable; \n* *prehook-ask-confirmation.sh* - asks for confirmation when pushing to the branches listed on *confirm_branches* variable. \n\n\n## Install\n\n* Enable git templates\n\n```bash\ngit config --global init.templatedir '~/.git-templates'\n\n```\n\n* create a directory to hold the global hooks:\n\n```bash\nmkdir -p ~/.git-templates/hooks\n```\n\n* get one of the hooks available, and copy it to the templates directory. Make sure to apply the correct filename to the hook being copied (Check [Githooks list](https://git-scm.com/docs/githooks)).\nExample: \n\n```bash\ncp prehook-push-denied.sh ~/.git-templates/hooks/pre-push\n```\n\n* make it executable\n\n```\nchmod a+x ~/.git-templates/hooks/pre-push\n```\n\n* if you like to add it to an existing project just re-init it: \n\n`[projectdir]$ git init`\n\nThis will not overwrite existing commits, or existing hooks.\nNew projects will have the hook instaled by default. \n\n* To remove it from a specific project, it has to be removed from the project's .git directory. \n\n\n## TODO\n* add a hook variation that allows to only push merges to a group of branches (use ```is_merge=$(git rev-parse -q --verify MERGE_HEAD)```).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flog-oscon%2Fgit-hooks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flog-oscon%2Fgit-hooks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flog-oscon%2Fgit-hooks/lists"}