Automatically update git project version numbers by placing a .version file.
- ugv: Single version update tool, supports Maven/Gradle/Rust/Python/Node.js
- fastugv: Git main/dev branch version release automation
sudo cp ugv /usr/local/bin
sudo cp fastugv /usr/local/bingitsed- fdfind
-
Place a
.versionfile in the project root directory with the version number, e.g.1.0.0. -
Mark the version number in files that need to be managed.
- Maven pom.xml
<version>1.0.0</version> <!-- managed by updgitver -->
- Gradle build.gradle
version = '1.0.0' // managed by updgitver
- Rust Cargo.toml
version = "1.0.0" # managed by updgitver
- Python pyproject.toml
version = "1.0.0" # managed by updgitver
- Python setup.py
version = "1.0.0", # managed by updgitver
- Node.js package.json
{ "name": "my-project", "version": "1.0.0" }Note: package.json version must be on line 3.
-
(Optional) The project is managed with
git.
ugv 1.0.1Will execute in the following order:
- Create a Git tag
v{old_version}_{yyyymmdd}based on the latest GitHEADand current date. - Create a Git branch
v{old_version}based on the latest GitHEAD. - Update version numbers in
pom.xml/build.gradle/Cargo.toml/pyproject.toml/setup.py/package.json. - Update version number in
.versionfile. - Commit changes with message
build: change to new version: {new_version}.
Automate version release workflow for projects with main/dev branch separation. Handles bidirectional sync between branches and version updates.
# Default: main and dev branches
fastugv <main_version> <dev_version>
# Custom branch names
fastugv <main_branch> <main_version> <dev_branch> <dev_version>fastugv 1.0.0 1.1.0Will execute:
- Checkout
mainbranch - Merge
devintomain - Run
ugv 1.0.0onmain(create tag, branch, update version) - Checkout
devbranch - Merge
mainintodev - Run
ugv 1.1.0ondev(create tag, branch, update version) - Checkout
mainbranch
- Release workflow with main/dev branch separation
- Automatic version synchronization between branches
- Ensures both branches have correct version numbers after release
- Single Source of Truth:
.versionfile is the unique source of version number - Marker-based Management: Version numbers are managed via
managed by updgitvercomments - Git Integration: Automatically create tags and branches to preserve version history
- Release Workflow:
fastugvenables bidirectional sync and version release for main/dev branches