{"id":15725262,"url":"https://github.com/isuke/git-consistent","last_synced_at":"2025-03-13T01:31:33.646Z","repository":{"id":65777629,"uuid":"120459230","full_name":"isuke/git-consistent","owner":"isuke","description":"Give consistency to your project's git logs.","archived":false,"fork":false,"pushed_at":"2023-09-01T14:25:30.000Z","size":10760,"stargazers_count":5,"open_issues_count":5,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-08T09:32:34.565Z","etag":null,"topics":["cli","commit","commitizen","emoji","git","git-duet","npm-package"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/git-consistent","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/isuke.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-02-06T13:17:17.000Z","updated_at":"2023-02-16T05:44:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"a5118b06-c13c-46e2-b299-9ae5632edb90","html_url":"https://github.com/isuke/git-consistent","commit_stats":{"total_commits":206,"total_committers":3,"mean_commits":68.66666666666667,"dds":0.009708737864077666,"last_synced_commit":"365f918540c6e3b93050367f0ed59af333ad3db7"},"previous_names":[],"tags_count":47,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isuke%2Fgit-consistent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isuke%2Fgit-consistent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isuke%2Fgit-consistent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isuke%2Fgit-consistent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/isuke","download_url":"https://codeload.github.com/isuke/git-consistent/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243322407,"owners_count":20272868,"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":["cli","commit","commitizen","emoji","git","git-duet","npm-package"],"created_at":"2024-10-03T22:20:14.519Z","updated_at":"2025-03-13T01:31:33.629Z","avatar_url":"https://github.com/isuke.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# git-consistent [![Test and Lint](https://github.com/isuke/git-consistent/actions/workflows/main.yml/badge.svg)](https://github.com/isuke/git-consistent/actions/workflows/main.yml) [![\"npm\"](https://img.shields.io/npm/v/git-consistent.svg)](https://www.npmjs.com/package/git-consistent) [![MIT](https://img.shields.io/github/license/mashape/apistatus.svg)](https://raw.githubusercontent.com/isuke/advanced-poe-filter/main/LICENSE) [![\"git-consistent friendly\"](https://img.shields.io/badge/git--consistent-friendly-brightgreen.svg)](\"https://github.com/isuke/git-consistent\")\n\n![](https://raw.githubusercontent.com/isuke/git-consistent/images/git-consistent01.gif)\n\nGive consistency to your project's git logs.\n\n[![\"node v14\"](https://img.shields.io/badge/node-v14-026e00.svg)](https://nodejs.org/en/download/releases)\n[![\"node v16\"](https://img.shields.io/badge/node-v16-026e00.svg)](https://nodejs.org/en/download/releases)\n[![\"node v17\"](https://img.shields.io/badge/node-v17-026e00.svg)](https://nodejs.org/en/download/releases)\n[![\"node v18\"](https://img.shields.io/badge/node-v18-026e00.svg)](https://nodejs.org/en/download/releases)\n[![\"node v20\"](https://img.shields.io/badge/node-v20-026e00.svg)](https://nodejs.org/en/download/releases)\n\n## Samples\n\n- [commitizen sample](https://gist.github.com/isuke/183057f709b14b997772ffee0a226e66)\n- [issue link sample](https://gist.github.com/isuke/1cc2931e30b4d59b2b623741ebff242b)\n- [issue link by branch name sample](https://gist.github.com/isuke/03d83037f13a671d0f0a0af5d76496f8)\n- [emoji sample](https://gist.github.com/isuke/fade15cf04b9e172ee76c2784119b44e)\n\n## Install\n\n```sh\n$ npm install -g git-consistent\n# or\n$ yarn global add git-consistent\n```\n\n### Optional settings\n\n```sh\n# set alias\n$ git config --global alias.con \"consistent -i\"\n\n# setting editor (for text type input) if you use editor other than vim.\n$ export EDITOR='code -w'\n# or\n$ export EDITOR='atom -w'\n# or\n$ export EDITOR='subl -w'\n# or etc.\n```\n\n## Usage\n\n### Init\n\n```sh\n$ git consistent --init\nUse Type? (Y/n): Y\nUse Emoji? (y/N): N\nDoes the subject start with lower case? (Y/n): Y\nDoes the subject put dot (.) at end? (y/N): Y\n\nGenerated '.gitcommit_template' and '.git_consistent'.\nYou can edit them freely.\nEnjoy!\n```\n\n### Output usage\n\n```sh\n$ git-consistent --help\n\n  Usage: git-consistent [options]\n\n\n  Options:\n\n    --type \u003ctype\u003e            commit type\n    -m, --subject \u003csubject\u003e  The subject contains succinct description of the change\n    --body [body]            The body contains details of the change (default: )\n    ...\n    -V, --version            output the version number\n    -h, --help               output usage information\n```\n\n### Inline mode\n\n```sh\n$ git consistent --type=\"feat\" --subject=\"implement new feature\" --body=\"This is amazing feature.\"\n```\n\n### Interactive mode\n\n```sh\n$ git consistent -i\nSelect type: feat\nEnter subject: implement new feature\nEnter body multiline:\nThis is amazing feature.\n```\n\nYou can use both mode interactive and inline at the same time.\nIn that case, you input value that are not given as option only.\n\n```sh\n$ git consistent -i --subject=\"implement new feature\"\nSelect type: feat\nEnter body multiline:\nThis is amazing feature.\n```\n\n`--subject` have alias of `-m`.\nYou can commit like you normally do!\n\n```\n$ git config --global alias.con \"consistent -i\"\n$ git con -m \"write README\"\n? Select type: docs\ngit commit -m \"docs: write README\"\n```\n\n### Advance\n#### Decorate\n\n```yml\nscope:\n  type: text\n  required: false\n  description: 'The scope could be specifying place of the commit change.'\n  prefix: '('\n  suffix: ')'\n```\n\n#### format check\n\n```yml\nsubject:\n  type: string\n  required: true\n  description: 'The subject contains succinct description of the change'\n  rules:\n    firstLetter: lower\n    dotAtEnd: false\n    ascii: false\n```\n\n```sh\n$ git consistent --subject=\"Write documents.\"\nsubject must be first letter is lowercase.\nsubject should not put dot (.) at the end.\n\n$ git consistent --subject=\"ドキュメントを書いた\"\nsubject must be first letter is lowercase.\nsubject should only alphabet.\n```\n\n#### variables\n\n```\n\u003cgithubIssueNum\u003e \u003csubject\u003e\n\n\u003cgithubIssueUrl\u003e\n\u003cbody\u003e\n```\n\n```yml\ngithubIssueNum:\n  type: string\n  required: false\n  description: 'github issue number'\n  prefix: 'fix #'\nsubject:\n  type: string\n  required: true\n  description: 'The subject contains succinct description of the change'\ngithubIssueUrl:\n  type: variable\n  origin: githubIssueNum\n  description: 'github issue url'\n  prefix: 'https://github.com/isuke/git-consistent/issues/'\nbody:\n  type: text\n  default: ''\n  required: false\n  description: 'The body contains details of the change'\n```\n\n```sh\n$ git consistent -i --subject=\"test\" --body=\"This is test.\"\nEnter githubIssueNum: 12\n\n$ git log -n 1\ncommit a9d6457f3674c8620fbe72c769cee09ba5459f02\nAuthor: isuke \u003cisuke770@gmail.com\u003e\nDate:   Sat Feb 10 17:40:33 2018 +0900\n\n    fix #12 test\n\n    https://github.com/isuke/git-consistent/issues/12\n    This is test.\n```\n\n#### branch\n\n```\n\u003csubject\u003e\n\n\u003cissueLink\u003e\u003cbody\u003e\n```\n\n```yml\n...\nissueLink:\n  type: branch\n  required: false\n  description: 'Github issue link'\n  regExp: 'issue([0-9]+)'\n  prefix: 'https://github.com/you/repository/issues/'\n  suffix: \"\\n\"\n...\n```\n\n```sh\n$ git branch\n* issue123_hoge\n  master\n\n$ git consistent -i --subject=\"test\" --body=\"This is test.\"\n\n$ git log -n 1\ncommit a9d6457f3674c8620fbe72c769cee09ba5459f02\nAuthor: isuke \u003cisuke770@gmail.com\u003e\nDate:   Sat Feb 10 17:40:33 2018 +0900\n\n    test\n\n    https://github.com/you/repository/issues/123\n    This is test.\n```\n\n#### emoji\n\n```yml\nemoji:\n  type: enum\n  required: true\n  description: 'commit type'\n  values:\n    -\n      name: ':heavy_plus_sign:'\n      description: 'when implementing function'\n    -\n      name: ':sunny:'\n      description: 'when fixing a bug'\n    -\n      name: ':art:'\n      description: 'when refactoring'\n```\n\n![](https://raw.githubusercontent.com/isuke/git-consistent/images/git-consistent02_emoji.png)\n\n#### git-duet\n\nRun [git-duet](https://github.com/git-duet/git-duet) mode when with `-d` option.\n\n```sh\n$ git consistent -d --type=\"feat\" --subject=\"duet test\" --body=\"\"\n\n$ git log -n 1\nAuthor: isuke \u003cisuke770@gmail.com\u003e\nDate:   Sat Feb 10 15:13:40 2018 +0900\n\n    feat: duet test\n\n    Signed-off-by: foo \u003cfoo@example.con\u003e\n```\n\n## Type list sample\n\n[sample type list](https://github.com/isuke/git-consistent/blob/master/sample_type_list.md)\n\n## .git_consistent format\n\n```\n\u003cterm\u003e:\n  \u003coption key\u003e: \u003coption value\u003e\n  \u003coption key\u003e: \u003coption value\u003e\n  \u003coption key\u003e: \u003coption value\u003e\n\u003cterm\u003e:\n  \u003coption key\u003e: \u003coption value\u003e\n  \u003coption key\u003e: \u003coption value\u003e\n  \u003coption key\u003e: \u003coption value\u003e\n\u003cterm\u003e:\n  \u003coption key\u003e: \u003coption value\u003e\n  \u003coption key\u003e: \u003coption value\u003e\n  \u003coption key\u003e: \u003coption value\u003e\n```\n\n| key              | description                                        | value                                                                    |\n| ---------------- | -------------------------------------------------- | ------------------------------------------------------------------------ |\n| term             | .gitcommit_template's term                         | string                                                                   |\n| option key       | term's options                                     | `type`, `required`, `description`, `values`, `prefix`, `suffix`, `rules` |\n| `type`           | term's input type                                  | `enum`, `string`, `text`, `variable`, `branch`                           |\n| `required`       | required?                                          | boolean                                                                  |\n| `description`    | term's description                                 | string                                                                   |\n| `values`         | enum's values                                      | Array                                                                    |\n| `prefix`         | a decoration to be attached before the input value | string                                                                   |\n| `suffix`         | a decoration to be attached after the input value  | string                                                                   |\n| `regExp`         | (`type: branch` only) regular expression for extracting values from branch names        | string                              |\n| `regExpMatchNum` | (`type: branch` only) number of values to retrieve from the match specified by `regExp` | string                              |\n| `regExpFlag`     | (`type: branch` only) `regExp`'s falg              | `i`                                                                      |\n| `rules`          | input value format rules                           | Object                                                                   |\n| rule key         | rule's type                                        | `firstLetter`, `dotAtEnd`, `nonAscii`, `numberOnly`                      |\n| `firstLetter`    | upper case or lower case about input value's first letter                               | `upper`, `lower`                    |\n| `dotAtEnd`       | need dot (`.`) input value's last                  | boolean                                                                  |\n| `nonAscii`       | Use not ascii symbols                              | boolean                                                                  |\n| `numberOnly`     | number only?                                       | boolean                                                                  |\n| `maxLength`      | max length of string                               | integer                                                                  |\n| `minLength`      | min length of string                               | integer                                                                  |\n\n## Command options\n\n| Option              | Description               |\n| ------------------- | ------------------------- |\n| `-d, --duet`        | run git-duet mode         |\n| `-D, --dry-run`     | run dry-run mode          |\n| `-i, --interactive` | run interactive mode      |\n| `-S, --silent`      | don't show commit command |\n| `-I, --init`        | generate config files     |\n| `-V, --version`     | output the version number |\n\n## Badges\n\n![git-consistent friendly](https://img.shields.io/badge/git--consistent-friendly-brightgreen.svg)\n\n* Markdown\n```\n[![git-consistent friendly](https://img.shields.io/badge/git--consistent-friendly-brightgreen.svg)](https://github.com/isuke/git-consistent)\n```\n\n* reStructuredText\n```\n.. image:: https://img.shields.io/badge/git--consistent-friendly-brightgreen.svg   :alt: git-consistent friendly   :target: https://github.com/isuke/git-consistent\n```\n\n* AsciiDoc\n```\nimage:https://img.shields.io/badge/git--consistent-friendly-brightgreen.svg[\"git-consistent friendly\",link=\"https://github.com/isuke/git-consistent\"]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisuke%2Fgit-consistent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fisuke%2Fgit-consistent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisuke%2Fgit-consistent/lists"}