/book/zh/v1/Git-%E5%9F%BA%E7%A1%80-%E6%89%93%E6%A0%87%E7%AD%BE
/github_27263697/article/details/79563949
1.列出现有标签
git tag
v0.1
v0.2
筛选
git tag -l "v1.4.2"
v1.4.2.1
v1.4.2.2
v1.4.2.3
新建标签
轻量级标签
git tag v1.2
含附注的标签
git tag -a v1.4 -m "my version 1.4"
git tag -a v1.4 //会打开你的默认文本编辑器
签署标签
如果你有自己的私钥,还可以用 GPG 来签署标签,只需要把之前的 -a 改为 -s (译注: 取 signed 的首字母)即可:
$ git tag -s v1.5 -m 'my signed 1.5 tag'
You need a passphrase to unlock the secret key for
user: "Scott Chacon <schacon@>"
1024-bit DSA key, ID F721C45A, created 2009-02-09
验证标签
...
查看标签
git show
后期加注标签
git log --pretty=oneline //查看编码
15027957951b64cf874c3557a0f3547bd83b3ff6 Merge branch 'experiment'
a6b4c97498bd301d84096da251c98a07c7723e65 beginning write support
0d52aaab4479697da7686c15f77a3d64d9165190 one more thing
6d52a271eda8725415634dd79daabbc4d9b6008e Merge branch 'experiment'
0b7434d86859cc7b8c3d5e1dddfed66ff742fcbc added a commit function
4682c3261057305bdd616e23b64b0857d832627b added a todo file
166ae0c4d3f420721acbb115cc33848dfcc2121a started write support
9fceb02d0ae598e95dc970b74767f19372d61af8 updated rakefile //给我添加tag
964f16d36dfccde844893cac5b347e7b3d44abbc commit the todo
8a5cbc430f1a9c3d00faaeffd07798508422908a updated readme
git tag -a v1.2 9fceb02
推送到远端仓库
push单个tag,命令格式为:git push origin [tagname]
push所有tag,命令格式为:git push [origin] --tags