https://git-scm.com/book/zh/v1/Git-%E5%9F%BA%E7%A1%80-%E6%89%93%E6%A0%87%E7%AD%BE
https://blog.csdn.net/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 <[email protected]>"
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