Git Tag Manager is a shell-based utility that simplifies the management of Git tags across projects. It enables users to configure project aliases, increment semantic versions (major, minor, patch, and build), and ensure synchronization with remote repositories. The tool is designed to streamline versioning workflows with clear and consistent tag generation.
- Project Configuration: Associate project aliases with local paths and remote URLs.
- Version Incrementation: Increment major, minor, patch, or build versions based on existing tags.
- Remote Synchronization: Always fetches the latest remote tags before creating new ones.
- Dry Run Mode: Display the Git push command without executing it.
- Help Command: Provides detailed usage instructions.
- Git installed and configured with SSH keys for remote access.
- Make installed.
- Clone the repository:
git clone <repository_url> cd <repository_directory>
- Build the project:
make build
- Install the binary:
cp dist/git-tag-manager /usr/local/bin/
git-tag-manager --help
git-tag-manager [COMMANDS] [OPTIONS]
--config <alias>|<local_path>|<remote_url>
- Configure a project with an alias, local path, and remote URL.
--alias <alias>
- Select the project by alias for subsequent operations.
--build
- Target the build number for incrementation.
--inc
- Increment the selected version component.
--major
,--minor
,--patch
- Specify which part of the version to increment.
--dry-run
- Show the Git push command without executing it.
--help
- Display this help message.
git-tag-manager --config "chest|/home/user/project/trove-chest/|git@your-git-server:trove-chest.git"
- Checks if the local path exists and verifies the remote URL.
- Clones the repository and sets up the remote if not found.
git-tag-manager --alias chest --build --inc
- Latest tag:
1.0.0-1
→ New tag:1.0.0-2
git-tag-manager --alias chest --build --patch --inc
- Latest tag:
1.0.0-2
→ New tag:1.0.1-1
git-tag-manager --alias chest --build --minor --inc
- Latest tag:
1.0.1-3
→ New tag:1.1.0-1
git-tag-manager --alias chest --major --inc
- Latest tag:
1.1.0-4
→ New tag:2.0.0
git-tag-manager --alias chest --major
- Latest tag:
1.1.0-4
→ New tag:1.1.0
git-tag-manager --alias chest --build --patch --inc --dry-run
Output:
git push origin 1.0.1-1
- The script always synchronizes with remote tags before incrementing.
- If the
tree
command is unavailable, it is silently ignored during build. - SSH keys must be properly configured for remote access.
Contributions are welcome! Please submit issues or pull requests for improvements.
This project is licensed under the MIT License.