{"id":17322608,"url":"https://github.com/ptgoetz/go-versionbump","last_synced_at":"2025-09-08T11:07:39.009Z","repository":{"id":255436478,"uuid":"850125245","full_name":"ptgoetz/go-versionbump","owner":"ptgoetz","description":"VersionBump is a command-line tool designed to automate version management in projects. It ensures version consistency across files, integrates with Git, and offers features like dry run mode, user confirmation, and verbose logging.","archived":false,"fork":false,"pushed_at":"2025-06-30T04:53:30.000Z","size":265,"stargazers_count":10,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-08T03:51:20.175Z","etag":null,"topics":["git","golang","semver","version-manager"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ptgoetz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-30T23:56:48.000Z","updated_at":"2025-06-30T04:53:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"08bcafae-8f35-453c-a9b9-27816b3b03b4","html_url":"https://github.com/ptgoetz/go-versionbump","commit_stats":null,"previous_names":["ptgoetz/go-versionbump"],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/ptgoetz/go-versionbump","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ptgoetz%2Fgo-versionbump","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ptgoetz%2Fgo-versionbump/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ptgoetz%2Fgo-versionbump/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ptgoetz%2Fgo-versionbump/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ptgoetz","download_url":"https://codeload.github.com/ptgoetz/go-versionbump/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ptgoetz%2Fgo-versionbump/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274174270,"owners_count":25235203,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-08T02:00:09.813Z","response_time":121,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["git","golang","semver","version-manager"],"created_at":"2024-10-15T13:42:47.812Z","updated_at":"2025-09-08T11:07:38.995Z","avatar_url":"https://github.com/ptgoetz.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-VersionBump\n\n![VersionBump Gopher](assets/versionbump_gopher-250.png)\n\n**Latest Version:** v0.8.0-alpha ([Install](#installation))\n\nVersionBump is a powerful command-line tool designed to streamline the process of version management in your projects. \nBy automating version bumping, VersionBump ensures that your project’s version numbers are always up-to-date across all \nrelevant files, reducing the risk of human error and saving you valuable time.\n\n## Quickstart\n\n1. **Install VersionBump**:\n   ```shell\n   go install github.com/ptgoetz/go-versionbump/cmd/versionbump@latest\n   ```\n\n2. **Initialize a New VersionBump Configuration File**:\n\n   In this example, we're accepting the default values for pre-release labels, build label, and initial version.\n   ```console\n    $ mkdir my-project \u0026\u0026 cd my-project\n    $ versionbump init\n    Enter pre-release labels (comma-separated) [alpha,beta,rc]: \n    Enter build label [build]:\n    Enter the initial version [0.0.0]:\n    Git is installed on this system.\n    Do you want to enable Git features? [y/N]: y\n    Do you want to enable Git commit feature? [y/N]: y\n    Do you want to enable the Git tag feature? [y/N]: y\n    ```\n   This will create a new `versionbump.yaml` configuration file in the current directory.\n3. **Show the Current Project Version**:\n   ```shell\n   $ versionbump show-version\n   Current project version: 0.0.0\n   ```\n4. **Show the Potential Versioning Paths**:\n   This will display the potential versioning paths for the current project version based on each possible bump strategy. \n   ```console\n   $ versionbump show\n    Potential versioning paths for project version: 0.0.0\n    0.0.0 ─┬─ major ─ 1.0.0\n           ├─ minor ─ 0.1.0\n           ├─ patch ─ 0.0.1\n           ├─ release ─ 0.0.0\n           ├─ new-pre-major ─ 1.0.0-alpha\n           ├─ new-pre-minor ─ 0.1.0-alpha\n           ├─ new-pre-patch ─ 0.0.1-alpha\n           ├─ pre ─ 0.0.0-alpha\n           ├─ pre-major ─ 0.0.0-alpha\n           ├─ pre-minor ─ 0.0.0-alpha.0.1\n           ├─ pre-patch ─ 0.0.0-alpha.0.0.1\n           ╰─ pre-build ─ 0.0.0+build.1\n   ```\n5. **Bump the Version**:\n\n   In the following example, we'll create a new pre-release patch version for an upcoming release.\n\n    ```console\n    $ versionbump new-pre-patch\n    VersionBump 0.6.0-alpha.2\n    Configuration file: versionbump.yaml\n    Project root directory: /Users/tgoetz/my-project\n    Checking git configuration...\n    Git version: 2.39.3 (Apple Git-146)\n    The project directory is not a git repository.\n    Do you want to initialize a git repository in the project directory? [y/N]: y\n    Initialized Git repository.\n    Adding tracked files...\n    Tracked Files:\n      - versionbump.yaml\n    Performing initial commit.\n    Current branch: main\n    Checking for existing tag...\n    GPG signing of git commits is enabled. Checking configuration...\n    WARNING: GPG signing of git commits is enabled by default in the git configuration. Consider enabling GPG signing in the VersionBump configuration.\n    Git commits will be signed with GPG key: ACEFE18DD2322E1E84587A148DE03962E80B8FFD\n    Tracked Files:\n      - versionbump.yaml\n    Bumping version part: new-pre-patch\n    Will bump version 0.0.0 --\u003e 0.0.1-alpha\n    versionbump.yaml\n         Find: \"version: \"0.0.0\"\"\n      Replace: \"version: \"0.0.1-alpha\"\"\n        Found 1 replacement(s)\n    Proceed with the changes? [y/N]: y\n    Updated file: versionbump.yaml\n    Commit Message: bump version 0.0.0 --\u003e 0.0.1-alpha\n    Tag Message: Release version 0.0.1-alpha\n    Tag Name: v0.0.1-alpha\n    Do you want to commit the changes to the git repository? [y/N]: y\n    Committing changes...\n    Committed changes with message: bump version 0.0.0 --\u003e 0.0.1-alpha\n    Tagging changes...\n    Tag 'v0.0.1-alpha' created with message: Release version 0.0.1-alpha\n   \n    # Show the current project version\n    $ versionbump show-version\n    0.0.1-alpha\n   \n    # Show the bump strategy tree for the current project version\n    $ versionbump show\n    Potential versioning paths for project version: 0.0.1-alpha\n    0.0.1-alpha ─┬─ major ─ 1.0.0\n                 ├─ minor ─ 0.1.0\n                 ├─ patch ─ 0.0.2\n                 ├─ release ─ 0.0.1\n                 ├─ new-pre-major ─ 1.0.0-alpha\n                 ├─ new-pre-minor ─ 0.1.0-alpha\n                 ├─ new-pre-patch ─ 0.0.2-alpha\n                 ├─ pre ─ 0.0.1-beta\n                 ├─ pre-major ─ 0.0.1-alpha\n                 ├─ pre-minor ─ 0.0.1-alpha.0.1\n                 ├─ pre-patch ─ 0.0.1-alpha.0.0.1\n                 ╰─ pre-build ─ 0.0.1-alpha+build.1\n    ```\n\n## Key Features\n\n- **Semantic Versioning**: Ensures that version numbers are always compliant with the Semantic Versioning specification.\n- **Automated Version Bumping**: Automatically updates version numbers in specified files, ensuring consistency and \n  accuracy.\n- **Git Integration**: Seamlessly integrates with Git to commit and tag changes, making version control effortless.\n- **GPG Integration**: Supports GPG signing of git commits and tags for enhanced security and authenticity.\n- **Interactive Mode**: Prompts for user confirmation before making changes, with options to disable prompts for a fully\n  automated experience.\n- **Verbose Logging**: Detailed logging for debugging and verification, with options to enable or disable as needed.\n- **Customizable Configuration**: Flexible configuration options to tailor VersionBump to your specific needs.\n\n## Rationale\nAny project that relies on version strings embedded in code and/or configuration files can get unwieldy pretty quickly\nif you have to manually update those version strings. VersionBump is designed to automate this process so you can focus\non writing code instead of updating version numbers.\n\n### Why Not [Insert Tool Here]?\nThere are many tools available that can automate version bumping, but VersionBump is designed to be simple, flexible,\nand unobtrusive. It is a single binary with no external dependencies, and it is easy to configure and use. It is also\ndesigned to be as safe as possible, with built-in safeguards to prevent accidental changes to your project.\n\nWith VersionBump you'll never have to switch between virtual environments, install dependencies, or worry about\ncompatibility issues. It is a simple, lightweight tool that gets the job done without any fuss, and will work with any\nproject that uses version strings in code or configuration files.\n\n#### Existing Projects with Similar Functionality\n\nThe following Python projects drove and inspired the development of VersionBump. \n- **[bumpversion](https://github.com/peritus/bumpversion)**: No longer maintained. Requires Python.\n- **[bump2version](https://github.com/c4urself/bump2version)**: No longer maintained. Requires Python.\n- **[bump-my-version](https://github.com/callowayproject/bump-my-version)**: This is the closest to VersionBump in terms\n  of intended functionality. Requires Python.\n\n**Why Not Use Python Tools?**\n\nThe problem at hand is essentially a text-based search and replace operation, with some extra external tool calls for git \nintegration. Dealing with Python dependencies, virtual environments, and compatibility issues is overkill for this\nproblem, especially when a tool's dependencies require switching between virtual environments so as not to conflict with\nyour prject's dependencies.\n\n### Do No Harm\nBy default VersionBump will do its best to not not make any changes to your project unless you approve them. You will\nbe prompted to confirm the changes before they are made. By default VersionBump will run in \"interactive\" and will \nprompt you to approve all changes and extensively log what actions it's performing.  To make VersionBump truly silent \nand prompt-less, you have use the `--no-prompt` and `--silent` flags.\n\nIf anything goes wrong, VersionBump will not make any changes to your project and will exit with a non-zero error code.\n\n## Is VersionBump Fully Semantic Versioning Compliant?\nYes and no.\n\n### Yes\nVersionBump will ensure that version numbers it creates/updates are always Semantic Versioning compliant. \n\n### No\nWhile VersionBump will ensure that the version numbers it creates/updates are always Semantic Versioning compliant, it\nis **opinionated** about how it does so. The Semantic Versioning specification allows for a wide range of pre-release\nand build versioning options. VersionBump tries to keep it simple, yet flexible. It supports customizable pre-release \nlabels and build labels. In general, VersionBump is more strict in terms of pre-release and build versioning.\n\n### Sample VersionBump Version Strings\nA VersionBump version string can be as simple as `1.2.3` or as complex as `1.2.3-alpha.4.5.6+build.7`. The following are\nvalid VersionBump version strings:\n- `1.2.3`\n- `1.2.3-alpha`\n- `1.2.3-alpha.1`\n- `1.2.3-alpha.0.1`\n- `1.2.3-alpha.0.0.1`\n- `1.2.3+build.1`\n- `1.2.3-alpha+build.1`\n- `1.2.3-alpha.1+build.1`\n- `1.2.3-alpha.0.1+build.1`\n- `1.2.3-alpha.0.0.1+build.1`\n\nYou can preview the potential versioning paths for a given version string using the `show` command described below.\n\n## Installation\n\n### With Go\nWhen installed with `go install`, it provides a `versionbump` binary that can be run from the command line.\n\n```shell\ngo install github.com/ptgoetz/go-versionbump/cmd/versionbump@latest\n```\n\n### Without Go\nIf you don't have Go installed and just want the binary executable, you can download a prebuilt binaries from  \n[here](https://github.com/ptgoetz/go-versionbump/releases/tag/v0.8.0-alpha).\n\nVersionBump binary distribution archives include the `README.md` and `versionbump[.exe]` files:\n\n```console\n$ unzip -l versionbump-v0.3.0-darwin-arm64.zip \nArchive:  versionbump-v0.3.0-darwin-arm64.zip\n  Length      Date    Time    Name\n---------  ---------- -----   ----\n  6082130  09-13-2024 21:23   versionbump\n    16573  09-13-2024 21:22   README.md\n---------                     -------\n  6098703                     2 files\n\n$ unzip -l versionbump-v0.3.0-windows-arm64.zip \nArchive:  versionbump-v0.3.0-windows-arm64.zip\n  Length      Date    Time    Name\n---------  ---------- -----   ----\n  6112256  09-13-2024 21:23   versionbump.exe\n    16573  09-13-2024 21:22   README.md\n---------                     -------\n  6128829                     2 files\n \n$ tar -ztvf versionbump-v0.3.0-linux-arm64.tgz\n-rwxr-xr-x  0 tgoetz staff 6103765 Sep 13 21:23 versionbump\n-rw-r--r--  0 tgoetz staff   16573 Sep 13 21:23 README.md\n\n\n```\n\nWhen installing from a binary archive, you should place the `versionbump[.exe]` binary file in a directory in your \nsystem path.\n\n## Usage\nRun VersionBump without any arguments to see the available flags and commands:\n\n```console\n$ versionbump \nVersionBump is a command-line tool designed to automate version string management in projects.\n\nUsage:\n  versionbump [flags]\n  versionbump [command]\n\nAvailable Commands:\n  completion    Generate the autocompletion script for the specified shell\n  config        Show the effective configuration of the project.\n  help          Help about any command\n  history       Show the sorted version history based on git tags.\n  init          Initialize a new versionbump configuration file.\n  latest        Show the latest project release version based on git tags.\n  major         Bump the major version number (e.g. 1.2.3 -\u003e 2.0.0).\n  minor         Bump the minor version number (e.g. 1.2.3 -\u003e 1.3.0).\n  new-pre-major Bump the major version and apply the first pre-release label (e.g. 1.2.3 -\u003e 2.0.0-alpha).\n  new-pre-minor Bump the minor version and apply the first pre-release label (e.g. 1.2.3 -\u003e 1.3.0-alpha).\n  new-pre-patch Bump the patch version and apply the first pre-release label (e.g. 1.2.3 -\u003e 1.2.4-alpha).\n  patch         Bump the patch version number (e.g. 1.2.3 -\u003e 1.2.4).\n  release       Bump the pre-release version to a release version (e.g. 1.2.3-alpha -\u003e 1.2.3).\n  pre           Bump the next pre-release version label (e.g. 1.2.3-alpha -\u003e 1.2.3-beta).\n  pre-build     Bump the pre-release build version number (e.g. 1.2.3 -\u003e 1.2.3+build.1).\n  pre-major     Bump the pre-release major version number (e.g. 1.2.3-alpha -\u003e 1.2.3-alpha.1).\n  pre-minor     Bump the pre-release minor version number (e.g. 1.2.3-alpha -\u003e 1.2.3-alpha.0.1).\n  pre-patch     Bump the pre-release patch version number (e.g. 1.2.3-alpha -\u003e 1.2.3-alpha.0.0.1).\n  set           Set the project version to the specified value.\n  show          Show potential versioning paths for the project version or a specific version.\n  show-version  Show the current project version.\n\n```\n\nThe commands `major`, `minor` `patch`, `release`, `set`, `new-pre-major`, `new-pre-minor`, `new-pre-patch`, `pre`, `pre-major`, \n`pre-minor`, `pre-patch` and `pre-build` support the following flags:'\n- `-c`, `-config`: Path to the configuration file (default: `./versionbump.yaml`).\n- `-no-prompt`: Do not prompt the user for confirmation before making changes.\n- `-no-git`: Do not commit or tag the changes in a Git repository.\n- `-no-color`: Disable colorized output.\n- `-q`, `-quiet`: Disable verbose logging.\n\nThe commands `config` and `show` support the following flags:\n- `-c`, `-config`: Path to the configuration file (default: `./versionbump.yaml`).\n- `-no-color`: Disable colorized output.\n\n## Configuration\nThe configuration file (**Default:** `versionbump.yaml`) defines the version bump settings:\n\n```yaml\nversion: \"0.0.0\"         # (REQUIRED) The current version of the project.\n\n# Git settings are optional. All default to `false`.\ngit-commit: false        # Whether to create a git commit for the version bump.\ngit-tag: false           # Whether to create a git tag for the version bump.\ngit-sign: false          # Whether to sign the git commit/tag.\n\nbuild-label: \"build\"     # The build label applied to build-level pre-release versions.\nprerelease-labels:       # The pre-release labels to cycle through (will be sorted lexically).\n  - \"alpha\"\n  - \"beta\"\n  - \"rc\"\n\nfiles:                   # The files to update with the new version.\n   - path: \"version.go\"  # The path to the file to update.\n     replace: \n      - \"v{version}\"     # The search string to replace in the file.\n\n   - path: \"README.md\"\n     replace: \n      - \"Latest Version: {version}\"\n```\n\n- `version`: REQUIRED The current version of the project This must be a [Semantic Versioning](https://semver.org/) \n             `major.minor.patch-prerelease+build` string.\n- `git-commit`: (Optional) Whether to `git commit` the changes.\n- `git-tag`: (Optional) Whether to tag the commit (implies `git-commit`).\n- `git-sign`: (Optional) Whether to sign the commit/tag with GPG.\n- `prerelease-labels`: (Optional) A list of pre-release labels to use for pre-release version bumps. These will be \nsorted lexically/aphabetically. When the `prerelease-next` bump part is used, it will advance to the next label (e.g. \n`alpha -\u003e beta`, `beta -\u003e rc`, etc.). Attempting to advance past the last label will produce an error (default: \n[`alpha`, `beta`, `rc`]).\n- `build-label`: (Optional) The build label to append to the version number (default: `\"\"`).\n- `files`: (Required) A list of files to update with the new version number.\n   - `path`: The path to the file. **Note**: Relative file paths are relative to the config file parent directory. \n             Absolute paths are used as-is.\n   - `replace`: A list of strings to replace with the new version number. Use `{version}` as a placeholder.\n\n**Important Note:**\n\nThe specified or default configuration file is implicitly included as a file that will undergo version replacement. It\nserves as the source of truth for the version number. VersionBump will always include it as a file to update with the\nnew version number.\n\n### Git Message Templates\nVersionBump will use the following templates for the commit and tag messages. You can customize these templates in the\nYAML configuration file.\n\n| Template Type      | Default Value                  | Config YAML Key            |\n|--------------------|--------------------------------|----------------------------|\n| Commit Message     | `Bump version {old} --\u003e {new}` | `git-commit-template`      |\n| Tag Name           | `v{new}`                       | `git-tag-template`         |\n| Tag Message        | `Release version {new}`        | `git-tag-message-template` |\n\nThe following placeholders can be used in the templates:\n- `{old}`: The old semantic version number.\n- `{new}`: The new semantic version number.\n\n## Examples\n\n### Configuration File\n```yaml\nversion: \"0.1.9\"          # The current version of the project.\ngit-commit: true          # Whether to create a git commit for the version bump.\ngit-tag: true             # Whether to create a git tag for the version bump.\ngit-sign: true            # Whether to sign the git commit/tag.\n\nfiles:                    # The files to update with the new version (i.e. \"Tracked files\").\n  - path: \"main.go\"       # The path to the file to update.\n    replace: \n      - \"v{version}\" # The search string to replace in the file.\n\n  - path: \"README.md\"\n    replace: \n      - \"**Current Version:** v{version}\"\n```\n\n### Default (Verbose) Output with Prompts\nIn the following scenario, the project is not a git repository but git features are enabled, so VersionBump will \noffer to initialize a git repository in the project directory. VersionBump will add tracked files to the git repository\nand perform an initial commit before continuing.\n\n```console\n$ versionbump patch\nVersionBump v0.8.0-alpha\nConfiguration file: versionbump.yaml\nProject root directory: /Users/tgoetz/Projects/ptgoetz/test-project\nChecking git configuration...\nGit version: 2.39.3 (Apple Git-146)\nThe project directory is not a git repository.\nDo you want to initialize a git repository in the project directory? [y/N]: y\nInitialized Git repository.\nAdding tracked files...\nTracked Files:\n  - main.go\n  - README.md\n  - versionbump.yaml\nPerforming initial commit.\nCurrent branch: main\nChecking for existing tag...\nGPG signing of git commits is enabled. Checking configuration...\nGit commits will be signed with GPG key: ACEFE18DD2322E1E84587A148DE03962E80B8FFD\nTracked Files:\n  - main.go\n  - README.md\n  - versionbump.yaml\nBumping version part: patch\nWill bump version 0.1.10 --\u003e 0.1.11\nmain.go\n     Find: \"v0.1.10\"\n  Replace: \"v0.1.11\"\n    Found 1 replacement(s)\nREADME.md\n     Find: \"**Current Version:** v0.1.10\"\n  Replace: \"**Current Version:** v0.1.11\"\n    Found 1 replacement(s)\nversionbump.yaml\n     Find: \"version: \"0.1.10\"\"\n  Replace: \"version: \"0.1.11\"\"\n    Found 1 replacement(s)\nProceed with the changes? [y/N]: y\nUpdated file: main.go\nUpdated file: README.md\nUpdated file: versionbump.yaml\nCommit Message: Bump version 0.1.10 --\u003e 0.1.11\nTag Message: Release version 0.1.11\nTag Name: v0.1.11\nDo you want to commit the changes to the git repository? [y/N]: y\nCommitting changes...\nCommitted changes with message: Bump version 0.1.10 --\u003e 0.1.11\nTagging changes...\nTag 'v0.1.11' created with message: Release version 0.1.11\n\n```\n### Suppressing Prompts and Verbose Output\n```console\n$ versionbump -no-prompt -quiet patch\n# No output\n\n$ echo $?\n0 # Success\n\n$ git log --show-signature --name-status HEAD^..HEAD # Show last commit\ncommit e695bb7aaa8d4f7b6c821eb13d15fe4c658a929f (HEAD -\u003e main, tag: v0.1.12)\ngpg: Signature made Fri Sep 13 19:08:11 2024 EDT\ngpg:                using RSA key ACEFE18DD2322E1E84587A148DE03962E80B8FFD\ngpg: Good signature from \"P. Taylor Goetz \u003cptgoetz@apache.org\u003e\" [ultimate]\ngpg:                 aka \"P. Taylor Goetz \u003cptgoetz@gmail.com\u003e\" [ultimate]\nAuthor: P. Taylor Goetz \u003cptgoetz@gmail.com\u003e\nDate:   Fri Sep 13 19:08:11 2024 -0400\n\n    Bump version 0.1.11 --\u003e 0.1.12\n\nM       README.md\nM       main.go\nM       versionbump.yaml\n\n```\n\n*** Init Command\nThe `init` command will create a new configuration file with default values in the current directory. If a configuration\nfile already exists, it will not be overwritten.\n\n```console\n$ versionbump init\nEnter pre-release labels (comma-separated) [alpha,beta,rc]: \nEnter build label [build]: \nEnter the initial version [0.0.0]: \n\n$cat versionbump.yaml\n# The current version of the project. This is the source of truth for the project version. \n# Set this once and let VersionBump manage it.\nversion: \"0.0.0\" \n\n# Git configuration (optional)\ngit-commit: false # Whether to create a git commit for the version bump.\ngit-sign: false   # Whether to sign the git commit and tag.\ngit-tag: false    # Whether to create a git tag for the version bump.\n\n# Git commit and tag templates. These are the templates used for the git commit and tag messages.\ngit-commit-template: \"bump version {old} --\u003e {new}\" # The template for the git commit message.\ngit-tag-template: \"v{new}\" # The template for the git tag name.\ngit-tag-message-template: \"Release version {new}\" # The template for the git tag message.\n\n# Prerelease labels. These are the labels that will be used for prerelease versions.\n# VersionBump with sort these labels in ascending order when determining the next version.\n# If the bump type is 'prerelease-next'', the next label will be used. Attempting to bump past the last label \n# will result in an error.\nprerelease-labels:\n  - \"alpha\"\n  - \"beta\"\n  - \"rc\"\n\n# The build label. This is the label that will be used for build versions.\nbuild-label: \"build\"\n\nfiles:  # The files to update with the new version (i.e. \"Tracked files\").\n# The following example will replace all occurrences of the old version with the new version in the README.md file.\n#   - path: \"README.md\"\n#    replace:\n#      - \"v{version}\"\n```\n\n### Show Command\nWithout parameters, the `show` command will display the potential versioning paths for the project version:\n```console\n$ 0.6.0-alpha.1 ─┬─ major ─ 1.0.0\n                 ├─ minor ─ 0.7.0\n                 ├─ patch ─ 0.6.1\n                 ├─ release ─ 0.6.0\n                 ├─ pre-new-major ─ 1.0.0-alpha\n                 ├─ pre-new-minor ─ 0.7.0-alpha\n                 ├─ pre-new-patch ─ 0.6.1-alpha\n                 ├─ pre ─ 0.6.0-beta\n                 ├─ pre-major ─ 0.6.0-alpha.2\n                 ├─ pre-minor ─ 0.6.0-alpha.1.1\n                 ├─ pre-patch ─ 0.6.0-alpha.1.0.1\n                 ╰─ pre-build ─ 0.6.0-alpha.1+build.1\n```\n\nYou can also specify any version identifier to see the potential versioning paths:\n```console\n$ versionbump show 0.4.1-alpha\nPotential versioning paths for version: 0.4.1-alpha\n0.4.1-alpha ─┬─ major ─ 1.0.0\n             ├─ minor ─ 0.5.0\n             ├─ patch ─ 0.4.2\n             ├─ release ─ 0.4.1\n             ├─ pre-new-major ─ 1.0.0-alpha\n             ├─ pre-new-minor ─ 0.5.0-alpha\n             ├─ pre-new-patch ─ 0.4.2-alpha\n             ├─ pre ─ 0.4.1-beta\n             ├─ pre-major ─ 0.4.1-alpha.1\n             ├─ pre-minor ─ 0.4.1-alpha.0.1\n             ├─ pre-patch ─ 0.4.1-alpha.0.0.1\n             ╰─ pre-build ─ 0.4.1-alpha+build.1\n\n\n```\n\n### History Command\nThe `history` command will display the sorted version history based on git tags. It will only show tags that are \nconsidered valid semantic version numbers.\n    \n```console\n$ versionbump history\nversion History:\n  - 0.7.0\n  - 0.7.0-alpha\n  - 0.6.0\n  - 0.6.0-alpha.1\n  - 0.6.0-alpha\n  - 0.5.4\n  - 0.5.3\n  - 0.5.2\n  - 0.5.1\n  - 0.5.0\n  - 0.4.1\n  - 0.4.0\n  - 0.3.0\n  - 0.2.0\n  - 0.1.1\n  - 0.1.0\n  - 0.0.2\n  - 0.0.1\n\n```\n\n### Config Command\n\nThe `config` command will display the effective configuration of the project. This will show default values for any\nconfiguration settings that are not explicitly set in the configuration file.\n\n```console\n$ versionbump config\nConfig file: versionbump.yaml\nProject root: /Users/tgoetz/Projects/ptgoetz/go-versionbump\nEffective Configuration YAML:\nversion: 0.6.0-alpha\nbuild-label: build\nprerelease-labels:\n- alpha\n- beta\n- rc\ngit-commit: true\ngit-commit-template: bump version {old} --\u003e {new}\ngit-sign: true\ngit-tag: true\ngit-tag-template: v{new}\ngit-tag-message-template: Release version {new}\nfiles:\n- path: internal/versionbump.go\n  replace:\n  - '\"{version}\"'\n- path: README.md\n  replace:\n  - '**Latest Version:** v{version}'\n  - /v{version}\n  - VersionBump v{version}\n- path: Makefile\n  replace:\n  - VERSION := \"v{version}\"\n- path: versionbump.yaml\n  replace:\n  - 'version: \"{version}\"'\n```\n\n## Failure Modes and Errors\nVersionBump does its best to prevent leaving your project in an inconsistent state. Before making any changes, it will\nperform a series of \"pre-flight\" checks to ensure that the version bump can be completed successfully. If any errors are\ndetected, VersionBump will exit with a non-zero error code and will not make any changes to your project.\n\nIf VersionBump is run in `--no-prompt` mode, it will exit with an error if any of the pre-flight checks fail. If it is\nrun in interactive mode (default), it will prompt the user to confirm whether to proceed with the version bump.\n\nIf git integration is enabled in the VersionBump configuration, VersionBump will also exit with an error if it detects \nthat any git operations (e.g., committing or tagging) will fail (e.g. the project directory is not a git repository).\nWhen running in interactive mode, VersionBump will prompt the user to correct git issues it can fix (e.g. initializing\na git repository).\n\n\n### Standard Pre-Flight Checks\n\n- **Configuration File**: VersionBump will check that the configuration file exists and is read/write. If the file is\n  missing or cannot be read or written, VersionBump will exit with an error.\n- **Version Number**: VersionBump will check that the version number in the configuration file is a valid semantic\n  version number. If the version number is invalid, VersionBump will exit with an error. Note that VersionBump will \n  normalize the version strings to a semantic version number before proceeding. For example the string `\"1.2.003\"` will\n  be normalized to `1.2.3`.\n- **Tracked Files**: VersionBump will check that all tracked files in the configuration file exist and are read/write. \n  If any files are missing or cannot be read, VersionBump will exit with an error.\n- **At Least One Replacement**: VersionBump will check that at least one replacement will be made in each tracked file\n  replacement. \n  If no replacements would be made, VersionBump will exit with an error.\n\n### Git Pre-Flight Checks\n\n- **Git Installed**: VersionBump will check that the `git` command is available in the system path. If the `git` command\n  is not available, VersionBump will exit with an error.\n- **Git Repository**: If git integration is enabled, VersionBump will check that the project directory is a git\n  repository. If the project directory is not a git repository, VersionBump will exit with an error.\n\n  In interactive mode, VersionBump will prompt the user to initialize a git repository in the project directory. It will\n  also add all tracked files to the git repository and commit them with the message \"Initial commit\".\n- **Git Clean**: VersionBump will check that the git repository is clean (i.e., no uncommitted changes). If the git\n  repository is not clean, VersionBump will exit with an error.\n- **Git Tagging**: If git tagging is enabled, VersionBump will check that the tag name does not already exist in the git\n  repository. If the tag name already exists, VersionBump will exit with an error.\n\n### GPG Pre-Flight Checks\n\nIf signing of git commits and tags is enabled, either in the VersionBump or git configuration, VersionBump will perform \nthe following additional checks:\n\n- **GPG Signing Key**: VersionBump will check that a GPG signing key is available in the git configuration \n  (`git config --get user.signingkey`). If no GPG signing key is available, VersionBump will exit with an error.\n- **Sign/Don't Sign Conflict**: If signing is disabled in the VersionBump configuration, but enabled in the git \n  configuration, VersionBump will log a warning message and continue. VersionBump will not override the git \n  configuration for signing.\n\n## Contributing\nIf you want to hack and/or contribute to VersionBump, look at the [DEVELOPER.md](DEVELOPER.md) file for more \ninformation.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fptgoetz%2Fgo-versionbump","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fptgoetz%2Fgo-versionbump","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fptgoetz%2Fgo-versionbump/lists"}