1、git tag可以用来给提交记录添加标签
轻量tag
//git tag <tagname> <commitId>或者<HEAD>
git tag 1.0.1 127ed72c77296c9a253a9ee9b9ab0d9d15342818
git push origin 1.0.1 //推送指定标签到远程仓库
或
git push origin --tags //推送所有标签
附注标签
git tag -a <tagname> <commitID> -m <message>
git tag -a 1.0.4 127ed72c77296c9a253a9ee9b9ab0d9d15342818 -m 正式版
轻量标签和附注标签效果如下
2、删除标签
git tag -d <tagname>
git tag -d 1.0.1 //删除本地标签
git push origin --delete 1.0.1删除远程仓库的标签
3、检出标签
git checkout -b release 1.0.4 //以1.0.4标签为基础,新建一个release分支
4、查看标签
git tag //查看所有标签
git show <tagname>
git show 1.0.4 //查看指定标签