Skip to main content

Automatically create semantic version git tags

Project description

Tag Release

Test status Deploy Status Go Reference Arch User Repsoitory PyPI Go Report Card

Automatically create semantic version git tags.

$ tag
Push tag 'v1.0.1' to origin? (y/N): y
Tag 'v1.0.1' created and pushed to origin.

Usage

By default, tag will increment the smallest digit following SemVer precedence. Incrementing a specific version is achieved by passing the respective flag: --major, --minor, --patch.

Tags can be automatically pushed to a remote repository by passing --push.

tag supports pre-release versions. Creating a pre-release tag is achieved by the using the --suffix flag. For example, --suffix="alpha" will create a tag like v1.0.0-alpha. If the previous tag was for a pre-release, that suffix is preferred. This behavior can be overridden by passing --patch or --suffix="". Only incrementing the trailing pre-release identifier is currently supported.

tag authoritatively discourages duplicate tags for a single commit.

For the most up-to-date options, run tag --help,

$ tag --help
Calculate the next semantic version tag

Usage:
  tag [flags]
  tag [command]

Available Commands:
  completion  Generate completion script
  help        Help about any command

Flags:
      --check             validate that the tag at HEAD has its previous version as an ancestor
      --debug             enable debug logging
  -h, --help              help for tag
      --major             increment the major version
      --metadata string   set the build metadata
      --minor             increment the minor version
      --patch             increment the patch version
      --prefix string     set a prefix for the tag
      --print-only        print the next tag and exit
      --push              create and push the tag to remote
      --remote string     remote repository to push tag to (default "origin")
      --suffix string     set the pre-release suffix (e.g., rc, alpha, beta)
  -v, --version           version for tag

Use "tag [command] --help" for more information about a command.

Autocomplete

tag provides autocomplete for bash, fish, powershell and zsh shells. For example, to enable autocomplete for the bash shell,

tag completion bash | sudo tee /etc/bash_completion.d/tag > /dev/null

Note: bash completion requires the bash-completion package be installed.

For more information, see tag completion <shell> --help for your respective <shell>.

Install

AUR:

tag is available from the Arch User Repository.

yay -S release-tag

pip:

tag is available as a pypi package.

pip install release-tag

go:

go install github.com/jmelahman/tag@latest

github:

Prebuilt packages are available from Github Releases.

Pre-commit

In your .pre-commit-config.yaml,

default_install_hook_types:
  - pre-push
repos:
  - repo: https://github.com/jmelahman/tag
    rev: a069af54b5de5379d3581e3fc027395d1ad0a982  # frozen: v0.5.0
    hooks:
      - id: tag-check

By default, it only runs on the pre-push stage, so you may need to install the pre-push hook after staging your changes.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

release_tag-0.5.1-py3-none-win_amd64.whl (1.3 MB view details)

Uploaded Python 3Windows x86-64

release_tag-0.5.1-py3-none-macosx_11_0_arm64.whl (1.2 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

release_tag-0.5.1-py3-none-macosx_10_12_x86_64.whl (1.3 MB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

Details for the file release_tag-0.5.1-py3-none-win_amd64.whl.

File metadata

  • Download URL: release_tag-0.5.1-py3-none-win_amd64.whl
  • Upload date:
  • Size: 1.3 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for release_tag-0.5.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 34eac6b6afbffc588d8c816dadf8ddea5ca5d9724371b3423e6a7eb88379833b
MD5 281b657aadf37a22e002e4882cda700b
BLAKE2b-256 3820ab278cabf7b266e8337b6e41b417803cef52f95b0865955ccb9d7d555b90

See more details on using hashes here.

File details

Details for the file release_tag-0.5.1-py3-none-macosx_11_0_arm64.whl.

File metadata

  • Download URL: release_tag-0.5.1-py3-none-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: Python 3, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for release_tag-0.5.1-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 54f21cf06d2a71045224ee9dcaad52089abb5d1fbc7a402cd75d749fb69c3f41
MD5 c5789b8def7cbcadc7fd306daa500433
BLAKE2b-256 ca613f80ac3909a8528568c468a8afeaf5603577a249747fea8bbc9f22f0e2d3

See more details on using hashes here.

File details

Details for the file release_tag-0.5.1-py3-none-macosx_10_12_x86_64.whl.

File metadata

  • Download URL: release_tag-0.5.1-py3-none-macosx_10_12_x86_64.whl
  • Upload date:
  • Size: 1.3 MB
  • Tags: Python 3, macOS 10.12+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for release_tag-0.5.1-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 a48b2bdae50b361a6b9067c3a015fcf2e4e7435efd7c64513c8cdef8e0d3770e
MD5 1cea3b9ae3a8307f533da9b2604c99ef
BLAKE2b-256 60df994a41cb8f8c43de1c90c4e8cc7ac08fef237fa36ff91f4f747e8056fdd4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page