Octo-Tag library help tagging in git
Octo-tag is a library that help you with versioning when adding a tag to remote/locally.
It will automatically generate a version, calculated based on the previous version, if the tag on git doesn't have history, it will make new ones.
You can install globally by running this command
npm install -g octo-tag
or you just want to install in specific project, you can do with
npm install octo-tag --dev
running this command
when you running this command, it will give you some question and confirmation to make sure the tag is correct.
The questions consist of :
Environment (Staging, Production or Beta), if you choose
staging, octo-tag will add
alpha.1in you tag, so the final tag will be
v0.0.1-alpha.1and if you choose
productionwill add tag like commonly
v0.0.1.( and the last one is beta on progress)
Semantic Version Type (major, minor, patch), if you choose major, it will make the first number in your version increase, say you has previous version i.e :
v1.0.0when you choose
majorit will increase to
v2.0.0, if you choose
minor, it will increase secondary number to
v1.1.0, and if you choose
patchit will increase last number to
Commit Id is used if you want add tag to specific commit/history id in your git.
Confirmation to add tag
Confirmation to push tag, in this step you can choose, you want to push the tag to remote/origin or not.
if you want to add prefix i.e from
octo-tag-1.0.0, you can add argument
How Octo-Tag Works :
Calculate Versioning :
octo-tag will get latest version in remote, if the latest version is v1.0.0, and you choose environment
stagingand semantic version
major. the versioning will generate
v2.0.0-alpha.1. or if
betaselected it will have
v2.0.0-alpha.1is exist, it will increase latest number, so the output will
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.