创建标签
[root@localhost ~]# cd /tmp/test/[root@localhost test]# git checkout masterSwitched to branch 'master'[root@localhost test]# git tag v1.0[root@localhost test]# git tagv1.0
查看标签信息
[root@localhost test]# git show v1.0commit 798b8a137d65fd7ed86d116246881582bd509f7dAuthor: hellopasswd <30693056+hellopasswd@users.noreply.github.com>Date: Sat Aug 4 11:57:18 2018 +0800 Create 2.docdiff --git a/2.doc b/2.docnew file mode 100644index 0000000..c7dc989--- /dev/null+++ b/2.doc@@ -0,0 +1 @@+2222
标签基于最新的commit打的
针对commit进行标签
[root@localhost test]# git tag v0.8 20de0e02b65fd3[root@localhost test]# git tagv0.8v1.0
简写commit
[root@localhost test]# git log --pretty=oneline --abbrev-commit798b8a1 Create 2.docd3231be Update 1.txt20de0e0 add 1.txtac97d4f add README.md
[root@localhost test]# git show v0.8commit 20de0e02b65fd3cdad2e68f44d82fd6d29d43581Author: rootDate: Fri Aug 3 14:12:00 2018 +0800 add 1.txtdiff --git a/1.txt b/1.txtnew file mode 100644index 0000000..9daeafb--- /dev/null+++ b/1.txt@@ -0,0 +1 @@+test
标签描述
[root@localhost test]# git tag -a v0.1 -m "first tag" ac97d4f63a2[root@localhost test]# git show v0.1tag v0.1Tagger: rootDate: Fri Aug 3 23:47:48 2018 +0800first tagcommit ac97d4f63a23ef07513954dd542f90ab4b6bf387Author: root Date: Fri Aug 3 13:58:01 2018 +0800 add README.mddiff --git a/README.md b/README.mdnew file mode 100644index 0000000..83c831f--- /dev/null+++ b/README.md@@ -0,0 +1 @@+# test
删除标签
[root@localhost test]# git tag -d v0.1Deleted tag 'v0.1' (was bd406bf)
推送指定标签到远程
[root@localhost test]# git push origin v1.0Total 0 (delta 0), reused 0 (delta 0)To git@github.com:hellopasswd/test.git * [new tag] v1.0 -> v1.0
页面测试
推送所有标签
[root@localhost test]# git push --tag originTotal 0 (delta 0), reused 0 (delta 0)To git@github.com:hellopasswd/test.git * [new tag] v0.8 -> v0.8
页面测试
删除远程标签
[root@localhost test]# git tag -d v0.8Deleted tag 'v0.8' (was 20de0e0)[root@localhost test]# git push origin :refs/tags/v0.8To git@github.com:hellopasswd/test.git - [deleted] v0.8
页面测试