Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorekmartin <mail@ekmartin.com>2015-12-06 02:38:13 +0300
committerKat Marchán <kzm@sykosomatic.org>2016-01-15 02:18:11 +0300
commit9ed2849cd7e8cc97111dca42a940905284afe55d (patch)
treee429f436d70a666c785bf9c4e5a034c840f795df /doc
parentf10d300e5effa7a5756c8d461eef284c283a41d1 (diff)
doc: add information about 'version from-git'
PR-URL: https://github.com/npm/npm/pull/10717 Credit: @ekmartin
Diffstat (limited to 'doc')
-rw-r--r--doc/cli/npm-version.md9
1 files changed, 5 insertions, 4 deletions
diff --git a/doc/cli/npm-version.md b/doc/cli/npm-version.md
index 6bd550659..2932516bb 100644
--- a/doc/cli/npm-version.md
+++ b/doc/cli/npm-version.md
@@ -3,7 +3,7 @@ npm-version(1) -- Bump a package version
## SYNOPSIS
- npm version [<newversion> | major | minor | patch | premajor | preminor | prepatch | prerelease]
+ npm version [<newversion> | major | minor | patch | premajor | preminor | prepatch | prerelease | from-git]
'npm [-v | --version]' to print npm version
'npm view <pkg> version' to view a package's published version
@@ -14,10 +14,11 @@ npm-version(1) -- Bump a package version
Run this in a package directory to bump the version and write the new
data back to `package.json` and, if present, `npm-shrinkwrap.json`.
-The `newversion` argument should be a valid semver string, *or* a
-valid second argument to semver.inc (one of `patch`, `minor`, `major`,
-`prepatch`, `preminor`, `premajor`, `prerelease`). In the second case,
+The `newversion` argument should be a valid semver string, a
+valid second argument to [semver.inc](https://github.com/npm/node-semver#functions) (one of `patch`, `minor`, `major`,
+`prepatch`, `preminor`, `premajor`, `prerelease`), or `from-git`. In the second case,
the existing version will be incremented by 1 in the specified field.
+`from-git` will try to read the latest git tag, and use that as the new npm version.
If run in a git repo, it will also create a version commit and tag.
This behavior is controlled by `git-tag-version` (see below), and can