repver
repver (short for “replace version”) is a command-line tool that automates batch replacement of simple strings—like version numbers—across multiple files in a Git repository, and optionally handles the entire pull request workflow with a single command.
- GitHub Repository: UnitVectorY-Labs/repver
- Documentation: repver.unitvectorylabs.com
Motivation
Keeping version numbers and other shared strings consistent across a repository is tedious and error-prone when done manually. Dependabot handles dependencies it understands, but it won’t update version strings embedded in documentation, Dockerfiles, CI configuration, or other custom metadata.
repver fills that gap. You describe an update once in a .repver configuration file—which files to touch, which line patterns to match, and what Git operations to perform—and then run a single command to apply that update consistently across however many files or repositories you need.
A typical repver run can:
- Create a new branch for the change
- Update multiple files by replacing a matched string with the new value
- Commit the changes
- Push the branch to the remote repository
- Create a pull request via the GitHub CLI
- Switch back to the original branch and delete the local branch
Example
The following .repver configuration updates Go version references in both go.mod and a GitHub Actions workflow file, then opens a pull request:
commands:
- name: "goversion"
params:
- name: "version"
pattern: "^(?P<major>0|[1-9]\\d*)\\.(?P<minor>0|[1-9]\\d*)\\.(?P<patch>0|[1-9]\\d*)$"
targets:
- path: "go.mod"
pattern: "^go (?P<version>.*) // GOVERSION$"
transform: "."
- path: ".github/workflows/build-go.yml"
pattern: "^ go-version: '(?P<version>.*)' # GOVERSION$"
transform: ".."
git:
create_branch: true
branch_name: "repver/go-v"
commit: true
commit_message: "Update Go version to "
push: true
remote: "origin"
pull_request: "GITHUB_CLI"
return_to_original_branch: true
delete_branch: true
With this configuration in place, updating to Go 1.23.4 is a single command:
repver --command=goversion --param-version=1.23.4
repver matches the annotated lines in each target file, replaces the version value with the appropriate transform, and drives the full Git workflow automatically.