{"id":17351925,"url":"https://github.com/jacobmgevans/git-graft","last_synced_at":"2025-04-14T21:24:29.801Z","repository":{"id":53581009,"uuid":"365071129","full_name":"JacobMGEvans/git-graft","owner":"JacobMGEvans","description":"NPX CLI tool that generates a configurable Git Hook that prepends branch name patterns to commit messages.","archived":false,"fork":false,"pushed_at":"2022-08-05T03:52:15.000Z","size":377,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-14T21:24:11.787Z","etag":null,"topics":["commit","commit-message","git","git-graft","git-hook"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/JacobMGEvans.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":"2021-05-07T00:28:49.000Z","updated_at":"2023-07-20T17:39:56.000Z","dependencies_parsed_at":"2022-09-02T00:41:32.982Z","dependency_job_id":null,"html_url":"https://github.com/JacobMGEvans/git-graft","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/JacobMGEvans%2Fgit-graft","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JacobMGEvans%2Fgit-graft/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JacobMGEvans%2Fgit-graft/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JacobMGEvans%2Fgit-graft/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JacobMGEvans","download_url":"https://codeload.github.com/JacobMGEvans/git-graft/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248961355,"owners_count":21190015,"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":["commit","commit-message","git","git-graft","git-hook"],"created_at":"2024-10-15T17:11:48.328Z","updated_at":"2025-04-14T21:24:29.772Z","avatar_url":"https://github.com/JacobMGEvans.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# git-graft\n\n[![oclif](https://img.shields.io/badge/cli-oclif-brightgreen.svg)](https://oclif.io)\n[![Version](https://img.shields.io/npm/v/git-graft.svg)](https://npmjs.org/package/git-graft)\n[![Downloads/week](https://img.shields.io/npm/dw/git-graft.svg)](https://npmjs.org/package/git-graft)\n[![License](https://img.shields.io/npm/l/git-graft.svg)](https://github.com/JacobMGEvans/git-graft/blob/master/package.json)\n\nNPX CLI tool that generates a configurable Git Hook that prepends branch name patterns to commit messages.\n\n**Features:**\n\n- Generated Git Hook\n- Zero Config Option -- Utilizing GitFlow\n\n  **Best Practice Examples**\n\n  - [GitKraken](https://www.gitkraken.com/learn/git/git-flow)\n  - [GitHub](https://www.gitkraken.com/learn/git/best-practices/git-branch-strategy#github-flow-branch-strategy)\n\n- Configurable [git-graft.json](#configuration)\n- Hook is a bin file running Node \u0026 no dependencies\n- Validates the commit message and branch\n- [Usage](#usage)\n- [Commands](#commands)\n\n# Usage\n\n```sh-session\n$ npx git-graft (-v|--version|version)\ngit-graft/0.0.0 linux-x64 node-v14.16.1\n$ npx git-graft --help\nMain Usage\n  $npx git-graft [COMMAND]\n...\n```\n\n# Commands\n\n## **Init**\n\n`init` will generate the Git Hook with Zero-Config or a configuration file based on prompts.\n\n**example:**\n\n```sh\nnpx git-graft init\n```\n\nThe prompts will be used to construct the [configuration](#configuration) file and ask to modify permissions to allow for execution of the generated Git Hook. Without permission to execute the Git Hook cannot work.\n\n## **Doctor**\n\nWill run file, directory, and permissions check on Git Graft Hook.\n\n**example:**\n\n```sh-session\n// automatically gets filepath\n$ npx git-graft doctor\n\n// user gives filepath\n$ npx git-graft doctor [FILEPATH] --force\n\n```\n\n# Configuration File\n\nThe [init](#init) generates a `git-graft.json` if **Zero-Config** isn't chosen. The config has properties for a configurable Git Hook. Configuration the patterns to validate the branch and resulting prepended commit message with branch information.\n\n**branchTypes:**\n\n`RegExp List` _required_ -- Refers to GitFlow best practices. Git Graft Hook will wrap the list in `()` and the constructor includes the forward slash \u0026 escape `\\/` [example](#regex-examples)\n\n**branchPattern:**\n\n`RegExp` _required_ -- Refers to the code/ticket and name of the branch following the branchType. [example](#regex-examples)\n\n**ticketTypes:**\n\n`string` _required_ -- Refers to the ticket code types, for example JIRA will use TICKETTYPE-{NUMBERS}. The Git Hook will use this config to construct a `RegExp` for the prepending to commit messages.\n\n**regExFlag:**\n\n`RegExp` _optional_ -- Flags to pass into RegEx constructors. Default: `gim`\n\n**ticketOnly:**\n\n`boolean` _optional_ -- Used to determine if ticket/code or whole branch should used. Default: `true`\n\n---\n\n### RegEx Examples:\n\n#### Zero Config RegExp Usage - https://regex101.com/r/UKwIK2/1\n\n#### branchPattern - https://regex101.com/r/ewym8B/1\n\n#### branchTypes - https://regex101.com/r/KNZio4/1\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacobmgevans%2Fgit-graft","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjacobmgevans%2Fgit-graft","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacobmgevans%2Fgit-graft/lists"}