Create and push an annotated tag in Git
# Create a tag on most current commit
git tag -a -m “tagging version 1.0″ v1.0
# Create a tag on a specific commit
git tag -a -m “tagging version 1.0″ v1.0 ec78b6b0778a1e02cb9554ce2dca4fcdd7a08a7d
# List tags
git tag -l
# Push tags to remote repository
git push –tags
# Push specific tag to remote repository
git push origin :tag_name
# Deleting a tag locally
git tag -d “v1.0″
# To push the deletion to remote repository
git push origin :refs/tags/v1.0
git tag options
-a
Make an unsigned, annotated tag object
-s
Make a GPG-signed tag, using the default e-mail address’s key
-u <key-id>
Make a GPG-signed tag, using the given key
-f
Replace an existing tag with the given name (instead of failing)
-d
Delete existing tags with the given names.
-v
Verify the gpg signature of the given tag names.
-l <pattern>
List tags with names that match the given pattern (or all if no pattern is given). Typing “git tag” without arguments, also lists all tags.
-m <msg>
Use the given tag message (instead of prompting). If multiple -m options are given, their values are concatenated as separate paragraphs. Implies -a if none of -a, -s, or -u <key-id> is given.
参考:
1. http://snipplr.com/view/16739/create-and-push-an-annotated-tag-in-git/
2. http://www.kernel.org/pub/software/scm/git/docs/git-push.html
3. http://www.kernel.org/pub/software/scm/git/docs/git-tag.html
Recent Comments