yarn icon indicating copy to clipboard operation
yarn copied to clipboard

"yarn version" should have an option to not commit to Git

Open Daniel15 opened this issue 10 years ago • 2 comments

Do you want to request a feature or report a bug? Feature

What is the current behavior? yarn version --new-version 1.2.3 always commits to Git. There's an ugly workaround: You can set the YARN_VERSION_GIT_TAG environment variable to an empty string:

YARN_VERSION_GIT_TAG='' yarn version --new-version 1.2.3

This is because version.js uses Boolean(config.getOption('version-git-tag')), and base-registry.js populates overrides for these config options from the environment variables. Since it uses the Boolean function and all environment variables are strings, the only value that works to disable it is an empty string.

What is the expected behavior? A --no-commit or --no-git-tag-version flag: Something like yarn version --new-version 1.2.3 --no-commit should update the version number without committing it. npm calls this --no-git-tag-version.

Daniel15 avatar Oct 19 '16 05:10 Daniel15

@Daniel15 I'll give this a shot today!

karanjthakkar avatar Oct 19 '16 10:10 karanjthakkar

Does this still work the same way as it did after #1243 was merged? Using --no-git-tag-version doesn't seem to be working for me... The YARN_VERSION_GIT_TAG='' yarn version ... trick still works though.

kylecombes avatar Apr 07 '22 18:04 kylecombes