{"id":19146745,"url":"https://github.com/lcluber/gitbranchvalidator","last_synced_at":"2026-01-22T05:33:03.560Z","repository":{"id":35207071,"uuid":"214797710","full_name":"LCluber/GitBranchValidator","owner":"LCluber","description":"Git branch name validator on Git hooks for clean workflow","archived":false,"fork":false,"pushed_at":"2023-01-04T22:59:10.000Z","size":868,"stargazers_count":2,"open_issues_count":15,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-14T16:53:26.325Z","etag":null,"topics":["branch","git","hook","husky","pre-commit","validation"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/LCluber.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":"2019-10-13T10:05:49.000Z","updated_at":"2023-01-31T17:38:04.000Z","dependencies_parsed_at":"2023-01-15T16:11:54.163Z","dependency_job_id":null,"html_url":"https://github.com/LCluber/GitBranchValidator","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/LCluber%2FGitBranchValidator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LCluber%2FGitBranchValidator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LCluber%2FGitBranchValidator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LCluber%2FGitBranchValidator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LCluber","download_url":"https://codeload.github.com/LCluber/GitBranchValidator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252799159,"owners_count":21805950,"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":["branch","git","hook","husky","pre-commit","validation"],"created_at":"2024-11-09T07:47:53.984Z","updated_at":"2026-01-22T05:33:03.532Z","avatar_url":"https://github.com/LCluber.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"### This project has been transferred to [DWTechs](https://github.com/DWTechs/GitBranchValidator). \n\n### Please update your project dependencies to the latest version [on the new repository](https://github.com/DWTechs/GitBranchValidator).\n\n\n[![License: MIT](https://img.shields.io/npm/l/@lcluber/gitbranchvalidator.svg)](https://opensource.org/licenses/MIT)\n[![npm version](https://badge.fury.io/js/%40lcluber%2Fgitbranchvalidator.svg)](https://www.npmjs.com/package/@lcluber/gitbranchvalidator)\n![Jest:coverage](https://img.shields.io/badge/Jest:coverage-100%25-brightgreen.svg)\n\n- [Synopsis](#synopsis)\n- [Motivation](#motivation)\n- [Installation](#installation)\n  - [npm](#npm)\n  - [Yarn](#yarn)\n  - [Local](#local)\n- [Usage](#usage)\n  - [Command line](#command-line)\n  - [Pattern](#pattern)\n  - [Workflow integration](#workflow-integration)\n- [Contributors](#contributors)\n- [License](#license)\n- [Stack](#stack)\n\n## Synopsis\n\n**[GitBranchValidator](https://github.com/LCluber/GitBranchValidator)** is an open source git branch name validator library.\n\n## Motivation\n\nThe goal of this library is to provide an easy way to check if the current branch name is valid before pushing it to the remote.\n\nIt's a good way to help developers keep their branch names clean on the repository and facilitate the workflow of a project with strict naming rules.\n\nThe default pattern follows the principles described [here](https://dwtechs.github.io/efficient-git/branch/).\n\nYou can also set your own rules using a [custom pattern](#pattern).\n\n## Installation\n\n### npm\n\n```bash\n$ npm i @lcluber/gitbranchvalidator -g\n```\n\n### Yarn\n\n```bash\n$ yarn add @lcluber/gitbranchvalidator -g\n```\n\n### Locally\n\nAlternatively, if you are planning to use GitBranchValidator within your npm package only or with npx you can install it as a devDependency in your project.\n\n```bash\n$ npm i @lcluber/gitbranchvalidator --save-dev\n```\n\n```bash\n$ yarn add @lcluber/gitbranchvalidator --dev\n```\n\n## Usage\n\n### Command line\n\n```bash\n$ cd \u003cgit-project\u003e\n$ gbvalidator\n```\n\nAlternatively if you did not install GitBranchValidator globally you can use npx.\n\n```bash\n$ npx gbvalidator\n```\n\nOr as an npm script in your package.\n\n```json\n{\n  \"scripts\": {\n    \"commit\": \"gbvalidator\"\n  }\n}\n```\n\n### Pattern\n\n- Default : **/^(feature|bugfix|release|hotfix|refactor|test|doc|build)\\/([a-z0-9_#-\\.\\/]){3,40}$/**\n\nThe default pattern follows the principles described [here](https://dwtechs.github.io/efficient-git/branch/).\n\nYou can use your own custom pattern by adding an optional regexp :\n\n```bash\n$ cd \u003cgit-project\u003e\n$ gbvalidator --pattern \"^(feat|fix)\\/([a-z0-9_#-\\.\\/]){3,50}$\"\n```\n\n_If you use this option for a npm command in package.json, you may need to properly escape your regex in order to get a valid JSON file._\n\n### Message\n\nYou can customize the end of the error message :\n\n```bash\n$ cd \u003cgit-project\u003e\n$ gbvalidator --message \"You can learn more about branch name conventions of this project on https://dwtechs.github.io/efficient-git/branch/\"\n```\n\n### Workflow integration\n\nValidate branch name on pre-commit with Husky :\n\n```bash\n$ npm install husky --save-dev\n```\n\n```json\n{\n  \"husky\": {\n    \"hooks\": {\n      \"pre-commit\": \"gbvalidator\"\n    }\n  }\n}\n```\n\n## options\n\n| Option    | Alias |  Type   |                                             description |\n| :-------- | :---: | :-----: | ------------------------------------------------------: |\n| --pattern |  -p   | string  |                                   to use a custom regex |\n| --message |  -m   | string  | to add a custom message at the end of the error message |\n| --help    |  -h   | boolean |                            to learn about library usage |\n\n## Contributors\n\nGitBranchValidator is still in development and I would be glad to get all the help you can provide for this project.\nTo contribute please read **[NOTICE.md](https://github.com/LCluber/GitBranchValidator/blob/master/NOTICE.md)** for detailed installation guide.\n\n## License\n\n**[MIT](https://github.com/LCluber/GitBranchValidator/blob/master/LICENSE)**\n\n## Stack\n\n| Purpose         |                Choice                |                                                 Motivation |\n| :-------------- | :----------------------------------: | ---------------------------------------------------------: |\n| repository      |    [Github](https://github.com/)     | hosting for software development version control using Git |\n| package manager | [npm](https://www.npmjs.com/get-npm) |                            default node.js package manager |\n| unit testing    |      [Jest](https://jestjs.io/)      |              delightful testing with a focus on simplicity |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flcluber%2Fgitbranchvalidator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flcluber%2Fgitbranchvalidator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flcluber%2Fgitbranchvalidator/lists"}