Skip to content

shu-go/git-cx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A conventional commits tool

Go Report Card MIT License

Install

GitHub Releases

You can download binaries from GitHub Releases Page.

go install

go install github.com/shu-go/git-cx@latest

Put git-cx to PATH

Usage

Basic

git cx

Customize commit types and rules

First, generate a rule file.

git cx gen

# The default name is .cx.yaml.

# You can give it a name
git cx gen myrule.yaml

Then, edit the file.

headerformat: '{{.type}}{{.scope_with_parens}}{{.bang}}: {{.emoji_unicode}}{{.description}}'
headerformathint: .type, .scope, .scope_with_parens, .bang(if BREAKING CHANGE), .emoji, .emoji_unicode, .description
types:
    '# comment1':
        desc: 'comment starts with #'
        emoji: ""
    feat:
        desc: A new feature
        emoji: ':sparkles:'
    fix:
        desc: A bug fix
        emoji: ':bug:'
    :
  },
denyemptytype: false
denyadlibtype: false
usebreakingchange: false

Record and complete scope history

Edit your gitconfig (I recommend to use shu-go/git-konfig)

[cx]
  scopes = myscopes.yaml

An example

git cx --debug

Type: feat
Scope: hoge
Description: new feature hoge!
Body: (Enter 2 empty lines to finish)
dummy text

----------
feat(hoge): ✨new feature hoge!

dummy text

The search order

  1. gitconfig ([cx] rule={PATH})
  2. current worktree root
  3. config directory
  4. exe dir
    • .cx.yaml
    • Place the yaml in the same location as the executable.