Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Permanently disable git tag version for npm version

Tags:

git

npm

When running the command "npm version" you can provide a --no-git-tag-version flag to stop tags from being generated and committed. Is there a way to make this the default behavior so I don't have to remember to type --no-git-tag-version every time?

like image 597
Nathan Kamenar Avatar asked Apr 20 '26 14:04

Nathan Kamenar


2 Answers

The first thing that comes to mind that is relatively easy to do is make an alias for this specific command. Something like

alias npm-nt="npm version --no-git-tag-version" # npm version no tag

Then just call npm-nt instead of npm version --no-git-tag-version.


Edit - given the comment about that this configuration should be shared with others, an option is to set this flag to false through npm config

By the docs of npm it's stated that this flag is true by default.

This in a project specific .npmrc file this can be set to false and can look something like

# in .npmrc
git-tag-version=false
like image 151
mnestorov Avatar answered Apr 23 '26 04:04

mnestorov


You can use,

npm config set git-tag-version false

to stop npm version permanently from creating tags and commits for npm version updates.

Note: This will be affected globally.

like image 37
Nipuna Avatar answered Apr 23 '26 04:04

Nipuna