Coder Social home page Coder Social logo

git-semver's Introduction

Git Semantic Versioning

Table Of Contents

Introduction

A git plugin to make adherance to Semantic Versioning 2.0.0 easier, with its own plugin architecture for optional version management of:

See PLUGINS.md for a description of plugins.

Semantic versioning

Semantic Versioning 2.0.0 is a scheme for versioning, which includes 3 parts e.g. 3.2.1 the components of which are:

  • Major: Used only for backward compatible breaking changes, i.e. when we have an all new theme etc.
  • Minor: Used for normal development, i.e. creating a new template
  • Bug fixes

Installation

Via git clone.

(git clone https://github.com/markchalloner/git-semver.git && sudo git-semver/install.sh)

The installer installs git-semver into the first of the following directories that exist and are in the path:

  • $HOME/.local/bin
  • $HOME/bin
  • /usr/local/bin
  • /usr/local/bin
  • /usr/bin
  • /bin

In Linux, OSX and Windows Cygwin the installer will create a symlink. In Windows MinGW creates a stub instead.

The installer will not overwrite any existing configuration or plugins.

Usage

Get highest version tag

git semver get

Will return empty if no version has been created.

Create a new version tag

Versions are created as tags and are generated using:

git semver [major|minor|patch|next|pre-release|build] [--dryrun] [-p <pre-release>] [-b <build>]

To see what a tag would be without actually creating it, run a dryrun with -d or --dryrun:

git semver patch --dryrun

Major

Increment the major component (0.1.0 -> 1.0.0), optionally adding a pre-release version and build metadata.

git semver major [-p <pre-release>] [-b <build>]

If no version has been created, the initial version will be: 1.0.0[-][+]

Minor

Increment the minor component (0.1.0 -> 0.2.0), optionally adding a pre-release version and build metadata.

git semver minor [-p <pre-release>] [-b <build>]

If no version has been created, the initial version will be: 0.1.0[-][+]

Patch (Next)

Increment the patch component (0.1.0 -> 0.1.1), optionally adding a pre-release version and build metadata.

git semver patch|next [-p <pre-release>] [-b <build>]

If no version has been created, the initial version will be: 0.1.0[-][+]

Pre-release

Create a new pre-release version based on the next patch version if a release version exists (0.1.0 -> 0.1.1-) or the current patch version (0.1.0-alpha -> 0.1.0-) if it does not, optionally adding build metadata.

git semver pre-release -p <pre-release> [-b <build>]

If no version has been created, the initial version will be: 0.1.0-[+]

Build

Create a new build based on the current patch version.

git semver build -b <build>

If no version has been created, the initial version will be: 0.1.0+

Help

Run git semver with no arguments to see usage

git semver [help]

Configuration

Git-semver will check for a configuration file in the following locations (and use the one that exists):

  • $GIT_REPO_ROOT/.git-semver
  • $XDG_CONFIG_HOME/.git-semver/config
  • $HOME/.git-semver/config

Git-semver will default to $HOME/.git-semver/config if no configuration file is found.

An example configuration file with the default settings can be found at config.example.

Updates

Updates can be done using git. Change to the cloned directory and run a git pull:

(cd $(dirname $(readlink $(which git-semver))) && git status)

Uninstallation

Automatically

Via uninstaller in clone directory. Navigate to your original clone directory and run:

sudo git-semver/uninstall.sh [-p|--purge]

The purge switch will additionally remove the configuration directory.

Manually

git-semver is installed by placing a symlink/stub in one of the bin directories in the path.

  • ${HOME}/.local/bin
  • ${HOME}/bin
  • /usr/local/bin
  • /usr/bin
  • /bin

It can be deleted easily:

sudo rm $(which git-semver)

The configuration directory can be removed with:

rm -rf ${HOME}/.git-semver

Changelog

Please see CHANGELOG.md for more information what has changed recently.

Contributing

Please see CONTRIBUTING.md for details.

git-semver's People

Contributors

aguegu avatar amimimor avatar fernandocollova avatar franciscocpg avatar markchalloner avatar particleflux avatar vladimino avatar zearin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.