Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/benjlevesque/git-autocommitmsg
Generates a conventional commit message based on the current branch name
https://github.com/benjlevesque/git-autocommitmsg
Last synced: 25 days ago
JSON representation
Generates a conventional commit message based on the current branch name
- Host: GitHub
- URL: https://github.com/benjlevesque/git-autocommitmsg
- Owner: benjlevesque
- License: mit
- Created: 2024-03-08T13:10:59.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-03-08T22:35:47.000Z (8 months ago)
- Last Synced: 2024-03-08T23:22:49.161Z (8 months ago)
- Language: Shell
- Size: 15.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# git-autocommitmsg
Generates a [conventional commit message](https://www.conventionalcommits.org/en/v1.0.0/) based on the current branch name.
## Install
```bash
curl -sSfL https://raw.githubusercontent.com/benjlevesque/git-autocommitmsg/main/godownloader.sh | sh -s -- -b /usr/local/bin
git config --global alias.autocommit "!git commit -m \"$(git-autocommitmsg)\""
```You can change the installation path by editing `/usr/local/bin` in the above command. Make sure the directory is in your `$PATH`
## Usage
1. Create a branch name based on your work (see [Examples](#Examples)):
```bash
gcb feat/users/create-user
```
> Tip: `gcb` is an alias for `git checkout -b`2. Stage your files
```bash
git add main.go
```3. Commit!
```bash
git autocommit
```The generated commit will be `feat(users): create user`
## Examples
| Branch name | Message |
| ---------------------- | ------------------------ |
| feat/users/create-user | feat(users): create user |
| chore/cleanup | chore: cleanup |
| fix/foo/hello--world | fix(foo): hello-world |## See also
- [git-branch-rename](https://github.com/benjlevesque/git-branch-rename): rename your current branch using your editor
- [gh](https://github.com/cli/cli): Github CLI