{"id":2886,"library":"bump2version","title":"bump2version","description":"Version-bump your software with a single command! This small command-line tool simplifies releasing software by updating all version strings in your source code by the correct increment. It also creates commits and tags, supports highly configurable version formats, works without any VCS but integrates with Git and Mercurial, and is compatible with Python 3 and PyPy3. This is an actively maintained fork of the original `bumpversion` project.","status":"active","version":"1.0.1","language":"en","source_language":"en","source_url":"https://github.com/c4urself/bump2version","tags":["versioning","cli","release management","semantic versioning","git"],"install":[{"cmd":"pip install bump2version","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"Requires Python 3.5 or newer.","package":"python","optional":false}],"imports":[],"quickstart":{"code":"# 1. Create a .bumpversion.cfg file in your project root:\n# [bumpversion]\n# current_version = 0.1.0\n# commit = True\n# tag = True\n# \n# [bumpversion:file:VERSION]\n# \n# 2. Create a file named VERSION with '0.1.0' inside.\n# \n# 3. Run the bump command:\n$ bump2version patch\n# This will update VERSION to 0.1.1, create a commit, and a tag.","lang":"bash","description":"Demonstrates bumping a patch version using a configuration file and a dedicated version file. The configuration enables automatic commit and tag creation."},"warnings":[{"fix":"Always install `bump2version` explicitly, or ensure your `pip` is recent enough to alias `bumpversion` to `bump2version`. Refer to the `c4urself/bump2version` GitHub repository for current documentation.","message":"The `bump2version` project is an actively maintained fork of the original `bumpversion` tool. While `pip install bumpversion` now installs `bump2version`, older documentation or direct installations of the unmaintained `bumpversion` could lead to different behavior or unpatched issues.","severity":"breaking","affected_versions":"<1.0.0 (original bumpversion)"},{"fix":"Always use `bump2version --dry-run <part>` first to preview changes. Ensure your `search` patterns are precise and match the exact version string in your files. Make sure the files specified in the config actually contain the `current_version` string as expected.","message":"If the `search` pattern in `.bumpversion.cfg` does not find a match in a file, `bump2version` may silently replace occurrences of `{current_version}` with `{new_version}` without a precise match, potentially corrupting the file's content or introducing unintended changes, instead of failing.","severity":"gotcha","affected_versions":"All versions"},{"fix":"If using pre-commit hooks, consider disabling `commit` and `tag` options in `bump2version` and handle Git operations manually in your CI/CD pipeline, or use `SKIP=VersionIncrement bump2version ...` to bypass pre-commit for bump2version's own commit.","message":"Using `commit = True` in `.bumpversion.cfg` or with CLI options can cause infinite loops if combined with Git pre-commit hooks that modify files or trigger further commits.","severity":"gotcha","affected_versions":"All versions"},{"fix":"For consistent behavior, it is highly recommended to use a `.bumpversion.cfg` file in your project root, which explicitly defines the `current_version` and file patterns. Alternatively, always provide `--current-version <version>` when running the CLI without a config.","message":"When bumping versions without a configuration file (`.bumpversion.cfg`), the `--current-version` argument is often required if `bump2version` cannot infer the current version from the specified files. This can be a source of confusion for new users expecting automatic detection.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}