Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save programmerShinobi/233cce400089522bdd93fe25155380e3 to your computer and use it in GitHub Desktop.
Save programmerShinobi/233cce400089522bdd93fe25155380e3 to your computer and use it in GitHub Desktop.
Steps to Update NPM Version, Push, and Manage Git Tags

Steps to Update NPM Version and Manage Git Tags

1. Update the NPM | YARN Version

Run the command below to increment the version:

$ yarn version --new-version 1.0.1 -m "<message>"

or

$ npm version <major | minor | patch> -m "<message>"
  • Replace <major | minor | patch> with:
    • major for significant changes.
    • minor for backward-compatible enhancements.
    • patch for backward-compatible bug fixes.
  • Replace <message> with a descriptive commit message for the version change.

2. Push Tags to Git

Push All Tags

To push all new tags to the remote repository, use:

$ git push --tags

Push a Single Tag

To push a specific tag to the remote repository, use:

$ git push origin <tag_name>
  • Replace <tag_name> with the specific tag you want to push.

Managing Tags

3. Delete a Local Tag (if needed)

To delete a single tag locally, use:

$ git tag -d <tag_name>
  • Replace <tag_name> with the specific tag you want to delete.

4. Delete a Remote Tag (if needed)

To delete a single tag from the remote repository, run:

$ git push --delete origin <tag_name>
  • Replace <tag_name> with the specific tag you want to delete remotely.

5. Delete Multiple Tags (if needed)

To delete multiple tags locally, you can use:

$ git tag -d <tag_name_1> <tag_name_2> ...
  • Replace <tag_name_1>, <tag_name_2>, etc., with the specific tags you want to delete.

To delete multiple remote tags, run:

$ git push --delete origin <tag_name_1> <tag_name_2> ...
  • Replace <tag_name_1>, <tag_name_2>, etc., with the specific tags you want to delete from the remote repository.

This structure clearly separates the processes for pushing all tags and individual tags, along with other tag management tasks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment