Git学习笔记(七)分支标签管理
★★★★★ 给分支添加标签
★ 首先要处于你要添加的那个分支上,然后运行 git tag tagName
★ 运行 git tag 来查看标签
★ 默认情况下,标签是添加在最新的commit上,如果想在历史版本上添加标签,首先 git log --pretty=oneline --abbrve-commit
在找到commit id之后, git tag tagName commitID 这样通过在指令后面添加 commit id 的方式给历史版本添加标签
★ 运行 git show tagName 来显示指定标签的对应的版本信息
★ 运行 git tag -a tagName -m "discription" commitID 给指定的 commit 添加描述信息 -a 指定标签名字
★ 运行 git tag -s tagName -m "discription" commitID 给指定的 commit 用私钥签名并添加信息 -s 私钥签名
★★★★★ 删除标签
★ 删除本地标签 git tag -d tagName
★ 推送标签到remote git push origin tagName 或者 git push origin --tags 一次推送所有标签到remote
★ 删除romote的tag git push origin :refs/tags/tagName (比如: git push origin :refs/tags/v1.0)

浙公网安备 33010602011771号