cli to help format your git commit messages consistently with less effort via pre-provided templates ๐คฉ
text
- โ ๏ธ break Breaking change that could break a consuming application
- ๐ bug Fix that resolves an unintended issue
- ๐ฆ deps Dependency update or migration to a new dependency
- ๐ docs Documentation change
- โจ feature Adds new functionality
- ๐งน refactor Improvement of code / structure without adding new functionality
- ๐งช test Adds or improves the existing tests related to the code base
[TICKET-123] ๐ fix
[TICKET-123] ๐งน Clean up
bash
cargo install git-kit
bash
git-kit --help
Lists currently available commit templates to add your own checkout Custom Commit templates.
```bash git-kit templates
Creates or checks out an existing git branch and adds a ticket number as context against that branch for future commits.
So now you don't have to remember the ticket number associated to the branch! ๐ก.
When it's time to commit your changes the provided ticket number will be injected into each commit message thats created on the linked branch for you automatically! ๐
bash
git-kit checkout my-branch -t TICKET-123
This will create or checkout a branch named
my-branch
& linkTICKET-123
as the ticket number context to inject on any future commits on the branch namedmy-branch
.
Most likely your ticket / issue will only have one branch associated to it in this case you can use the following shorthand ๐
bash
git-kit checkout TICKET-123
This will create or checkout a branch
TICKET-123
& linkTICKET-123
as the ticket number context to inject on any future commits on the branchTICKET-123
.
Create or update context linked to the current checked out branch.
This is handy if you forgot to checkout by the provided git-kit
checkout command or if you've made a typo
in on the provided ticket number.
Again when it's time to commit your changes the provided ticket number will be injected into each commit message thats created on the linked branch for you automatically!
bash
git-kit context TICKET-123
Commits your changes with a formatted message with your ticket number injected if provided from the checkout or the context command.
When committing you can specify a template to use to help describe the changes made within your commit.
text
- โ ๏ธ break Breaking change that could break a consuming application
- ๐ bug Fix that resolves an unintended issue
- ๐ฆ deps Dependency update or migration to a new dependency
- ๐ docs Documentation change
- โจ feature Adds new functionality
- ๐งน refactor Improvement of code / structure without adding new functionality
- ๐งช test Adds or improves the existing tests related to the code base
bash
git-kit commit bug -m "fix"
This will create an editable commit with the following format and will insert branch name will be injected by default into the
bug
commit template.
[TICKET-123] ๐ fix
You can provide your own templates simply by creating your own configuration file .git-kit.yml within your git repositories root directory.
By default the global configuration templates will be used as shown here if no configuration file is present.
Here's an example of a custom template called 'custom'
yaml
commit:
templates:
custom:
description: My custom commit template ๐ธ
content: |
{ticket_num} ๐ค {message}
To ensure your template has been loaded simply run ๐ to see a list of the currently configured templates.
```bash git-kit templates
Then when your ready use it! ๐ช
bash
git-kit commit custom \
--ticket TICKET-123 \
--message "Dang!"
[TICKET-123] ๐ค Dang!
At the moment the global config is technically can be overridden but I wouldn't recommend it as global config files will be replaced on update to pull any newly added templates.
In the near future we will add a way to configure your own config location to circumvent this issue.