8000 GitHub - ffhenkes/git-tag-manager: A simple script to manage tags. It works with semantic version in the form of "major"."minor"."patch"-"build"
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

A simple script to manage tags. It works with semantic version in the form of "major"."minor"."patch"-"build"

Notifications You must be signed in to change notification settings

ffhenkes/git-tag-manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
8000  
 
 
 
 
 
 

Repository files navigation

Git Tag Manager

Overview

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.

Features

  • 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.

Installation

Prerequisites

  • Git installed and configured with SSH keys for remote access.
  • Make installed.

Steps

  1. Clone the repository:
    git clone <repository_url>
    cd <repository_directory>
        
  2. Build the project:
    make build
        
  3. Install the binary:
    cp dist/git-tag-manager /usr/local/bin/
        
git-tag-manager --help

Usage

Command Structure

git-tag-manager [COMMANDS] [OPTIONS]

Commands

--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.

Examples

Configure a Project

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.

Increment Build Number

git-tag-manager --alias chest --build --inc
  • Latest tag: 1.0.0-1 → New tag: 1.0.0-2

Increment Patch and Reset Build

git-tag-manager --alias chest --build --patch --inc
  • Latest tag: 1.0.0-2 → New tag: 1.0.1-1

Increment Minor Version

git-tag-manager --alias chest --build --minor --inc
  • Latest tag: 1.0.1-3 → New tag: 1.1.0-1

Increment Major Version Without Build

git-tag-manager --alias chest --major --inc
  • Latest tag: 1.1.0-4 → New tag: 2.0.0

Release Version Without Build

git-tag-manager --alias chest --major
  • Latest tag: 1.1.0-4 → New tag: 1.1.0

Dry Run Example

git-tag-manager --alias chest --build --patch --inc --dry-run

Output:

git push origin 1.0.1-1

Notes

  • 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.

Contributing

Contributions are welcome! Please submit issues or pull requests for improvements.

License

This project is licensed under the MIT License.

About

A simple script to manage tags. It works with semantic version in the form of "major"."minor"."patch"-"build"

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  
0