git-标签管理
一、标签管理
查看所有标签:git tag
查看标签内容:git show 【标签名】
给分支打标签:git tag 【标签名】
针对描述版本号打标签:git tag 【标签名】【描述版本号】
删除标签:git tag -d 【标签名】
删除远程的标签:git push origin :refs/tags/【标签名】
推送标签:git push origin 【标签名】
推送所有标签:git push --tag origin
1:给master分支打标签,标签名为v1.0
查看当前所处分支是否master
[root@ghs gitroot]# git branch
* master
给master分支打标签为v1.0
[root@ghs gitroot]# git tag v1.0
查看标签是否成功
[root@ghs gitroot]# git tag
v1.0
2:针对commit版本号进行打标签
查看commit描述
[root@ghs gitroot]# git log --pretty=oneline --abbrev-commit
b994e16 add yuanche.txt
6d201b8 baoliu.txt
b44b4fd delect ghs.txt
fe23205 change 111 ghs.txt
8267cae change chongtu1 ghs.txt
6bb6ea0 change ghs.txt
c826e3c deleted 2.txt
50e5af9 add new 2.txt
02e331c add xiugai 1.txt
c343394 add 1.txt
697af57 add 1.txt
给版本02e3的1.txt打标签为V2.0
[root@ghs gitroot]# git tag v2.0 02e3
查看是否有v2.0标签
[root@ghs gitroot]# git tag
v1.0
v2.0
3:删除v1.0标签
[root@ghs gitroot]# git tag -d v1.0
Deleted tag 'v1.0' (was b994e16)
查看标签,是否还存在v1.0
[root@ghs gitroot]# git tag
v2.0
记录每一天有趣的事情!!

浙公网安备 33010602011771号