Understanding NPM Versioning With Git Tags

$ npm version patch
$ git push —-tags origin master
$ npm publish
npm version patch

If run in a git repo, it will also create a version commit and tag.

git push — tags origin master
npm publish

This behavior is controlled by git-tag-version (see below), and can be disabled on the command line by running npm — no-git-tag-version version. It will fail if the working directory is not clean, unless the — force flag is set.



Software Engineer. Ski fiend. Dog lover. Video game enthusiast.

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store