Skip to content

fix: add --tag-only flag to tag HEAD without bumping#283

Open
maimul wants to merge 1 commit into
c4urself:masterfrom
maimul:fix/256-tag-only
Open

fix: add --tag-only flag to tag HEAD without bumping#283
maimul wants to merge 1 commit into
c4urself:masterfrom
maimul:fix/256-tag-only

Conversation

@maimul

@maimul maimul commented May 30, 2026

Copy link
Copy Markdown

Problem

There's no way to tag the current HEAD using the version from config without also bumping version numbers. This blocks a common workflow where a build artifact needs to be committed between the version bump commit and the release tag:

bumpversion patch         # bumps 1.0.0 -> 1.0.1, commits, but also tags too early
# ... build artifact, can't add it to the tag commit after the fact

Fix

Add --tag-only flag. When passed, bumpversion reads current_version from config, tags HEAD, and exits — no file edits, no commit.

Usage

bumpversion patch --no-tag     # bump + commit, skip the tag
# ... build artifact, git add, git commit ...
bumpversion --tag-only         # tag HEAD now at the bumped version

The --tag-only flag is parsed in phase 1 (before any positional argument is required), so no patch/minor/major argument is needed.

Fixes #256

Adds a --tag-only flag that reads current_version from config, tags the
current HEAD, and exits — without bumping version numbers or committing
any files. This is useful when a build artifact must be committed between
the version bump commit and the release tag:

  bumpversion patch --no-tag   # bump + commit, no tag
  # git add artifact && git commit
  bumpversion --tag-only       # tag HEAD at the bumped version

Fixes c4urself#256
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

How to split bumping and tagging to allow intermediate step in between

1 participant