Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Useful set of tools which helps to manage git tags

License

NotificationsYou must be signed in to change notification settings

kazhuravlev/git-tools

Repository files navigation

Go ReferenceLicenseBuild StatusGo Report CardMentioned in Awesome Go

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

Installation

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

Usage

All commands work with the current directory by default. Use--repo=/path/to/repo to specify a different repository.

Commands

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)

Options

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

Examples

# 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

About

Useful set of tools which helps to manage git tags

Topics

Resources

License

Stars

Watchers

Forks


[8]ページ先頭

©2009-2025 Movatter.jp