package-version-git-tag v3.0.0
package-version-git-tag
Add Git tag corresponding to the version field of package.json.
Install
npm install --save-dev package-version-git-tagUsage
$ package-version-git-tag --help
package-version-git-tag v3.0.0
Add Git tag corresponding to the version field of package.json
Usage:
$ package-version-git-tag [options]
Options:
-V, -v, --version Display version number
-h, --help Display this message
--push `git push` the added tag to the remote repository
--verbose show details of executed git commands
-n, --dry-run perform a trial run with no changes made For example, suppose that package.json exists in the current directory, and version is 1.2.3:
{
"name": "my-awesome-package",
"version": "1.2.3",
...
}In this case, this command is:
package-version-git-tagEquivalent to this operation:
$ git tag v1.2.3 -m 1.2.3If you add the --push flag, it will also run git push. That is, this command is:
package-version-git-tag --pushEquivalent to this operation:
$ git tag v1.2.3 -m 1.2.3
$ git push origin v1.2.3Customize tag name format
If you want to customize the tag name format, you can take the following steps:
If you are execute this command with yarn, change the
version-tag-prefixsetting of yarn. This can be achieved by executing the following command:# Set the tag prefix to "foo-bar-" yarn config set version-tag-prefix foo-bar-Another way is to create the
.yarnrcfile:.yarnrc# Set the tag prefix to "foo-bar-" version-tag-prefix foo-bar-Note: Currently, Yarn 2 is not supported.
Otherwise, change the
tag-version-prefixsetting of npm. This can be achieved by executing the following command:# Set the tag prefix to "foo-bar-" npm config set tag-version-prefix foo-bar-Another way is to create the
.npmrcfile:.npmrc; Set the tag prefix to "foo-bar-" tag-version-prefix = "foo-bar-"
Tests
To run the test suite, first install the dependencies, then run npm test:
npm install
npm testChange Log
see CHANGELOG.md
Contributing
see CONTRIBUTING.md