Skip to content

Instantly share code, notes, and snippets.

@schneefisch
Last active April 4, 2023 07:11
Show Gist options
  • Save schneefisch/960b074bb664858eed51f776757bbfa5 to your computer and use it in GitHub Desktop.
Save schneefisch/960b074bb664858eed51f776757bbfa5 to your computer and use it in GitHub Desktop.
Basics for git tag

Tagging

checkout a specific tag

git co tags/1.5.0.0

fetch tags

git fetch --tags

list all tags

git tag

list only certain tags

git tag -l "v1.8.5*"

add tag

git tag -a v1.4.1 -m "my version 1.4"
git push origin v1.4.1

or, to push all tags at once

git push origin --tags

Move an existing tag on remote

git checkout <commi_you_want_to_move_the_tag_to>
git tag --force <tag_name>
git push --delete origin <tag_name>
git push --tags
git fetch -p
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment