dev-master
9999999-dev
The Requires
- php ^5.5|^7.0
- symfony/console ^3.1
- symfony/process ^3.1
The Development Requires
git
v1.0.0
1.0.0.0
The Requires
The Development Requires
git
Wallogit.com
2017 © Pedro Peláez
A CLI tool to generate semantic versioning compliant tags for your git repositories., (*2)
sudo chmod -R 755 git-semver
sudo mv git-semver /usr/local/bin/git-semver
Below is the signature for command, (*3)
$ git semver <patch|minor|major> [options]
Where patch, minor or major specifies the type of release that you are about to make., (*4)
patch use this option when you make backwards-compatible bug fixesminor use this option when you add functionality in a backwards-compatible mannermajor use this option when you make incompatible API changesIn addition to the type of release i.e. patch, major or minor, you can add following options to modify the behavior of command, (*5)
--fetch Fetch the remote tags before applying the version (Recommended)--prefix Prefix to prepend to the tag e.g. --prefix=v to prepend v i.e. for tags similar to v1.0.1
--postfix Append to the tag e.g --postfix="-live" to append -live to generate tags similar to 1.2.3-live
Find some of the usage examples below, (*6)
x.y.1, if the last tag was x.y.0
$ git semver patch
x.2.z then it will become x.3.z
$ git semver minor
0.y.z then it will become 1.y.z
$ git semver major
If you would want to fetch the remote tags before creating the tag, then use the --fetch option. For example, (*7)
$ git semver patch --fetch
Above command will make sure that the remote tags are fetched before creating a new tag. On a sidenote, it is recommended to add this flag e.g. if you are working in a team it is quite possible that you might not have some tag locally and creating a tag without fetching might end up in duplicated tags., (*8)
Prefix
If you want to create a release while prefixing some keyword e.g. v then you can provide that using --prefix option. For example:, (*9)
$ git semver patch --prefix=v
The above command will generate tags with v prefixed e.g. v1.0.0 or v1.3.2., (*10)
Postfix
If you would like to append something to the end of created tag you can use --postfix option. For example, if you would want to append -dev to the tag, you can do the below, (*11)
$ git semver patch --postfix=-dev
This will result in something along the lines of 3.5.1-dev depending upon the last tag, (*12)
Some useful examples of semantic versioning are given below:, (*13)
v0.0.0 // New project v0.1.0 // Add some functionality v0.2.0 // Add other new functionality v0.2.1 // Fix bug v0.3.0 // Add some functionality v0.3.1 // Fix bug v0.3.2 // Fix bug v0.3.3 // Fix bug v0.3.4 // Fix bug v0.4.0 // Add some functionality v0.4.1 // Fix bug v0.4.2 // Fix bug v1.0.0 // Code is being used in production v1.1.0 // Add some functionality v1.2.0 // Add other new functionality v1.2.1 // Fix bug v2.0.0 // Implement changes that causes backwards incompatible
Feel free to fork, improve, create issues and spread the word., (*14)
MIT © Zeeshan Ahmed, (*15)
git
git