




A CLI tool for managing git repositories with semantic versioning tags. Simplifies version bumping, tag validation, andgit hook management.
Quick example:
git commit -am"changes"&& gt t i min&& git push --follow-tags# Commits changes, increments minor version (e.g., v1.2.3 → v1.3.0), ready to push
Key features:
- Automatic semver tag incrementing (major/minor/patch)
- Tag format consistency checking (
v1.2.3 vs1.2.3) - Git hook installation (commit-msg with branch name)
- Author statistics
Golang
go install github.com/kazhuravlev/git-tools/cmd/gt@latest
Homebrew
brew install kazhuravlev/git-tools/git-tools
Docker (zsh) (will work only in current directory)
echo'alias gt="docker run -it --rm -v `pwd`:/workdir kazhuravlev/gt:latest"'>>~/.zshrc
All commands work with the current directory by default. Use--repo=/path/to/repo to specify a different repository.
Tag Management:
gt tag last# Show last semver tag (alias: gt t l)gt tag last -f tag# Show only tag name (useful for CI/CD)gt tag increment major# Bump major version: v1.2.3 → v2.0.0 (alias: gt t i maj)gt tag increment minor# Bump minor version: v1.2.3 → v1.3.0 (alias: gt t i min)gt tag increment patch# Bump patch version: v1.2.3 → v1.2.4 (alias: gt t i pat)
Other Commands:
gt lint# Validate tag format consistencygt authors# List commit authors with statistics (alias: gt a)gt hooks install all# Install git hooks (alias: gt h i a)gt hooks list# List available hooks (alias: gt h l)
Force tag creation:
# Create a new tag even if current commit already has a semver taggt t i min --ignore-exists-tag
Custom repository path:
gt --repo=/path/to/repo tag last
# Typical workflow: commit, bump version, pushgit commit -am"Add new feature"gt t i min# Creates v1.3.0 taggit push --follow-tags# CI/CD: Get version for build artifactVERSION=$(gt tag last -f tag)echo"Building version:$VERSION"# Check tag consistency before releasegt lint