晚来天欲雪,能饮一杯无!
这位大侠,硬套路在此,接招!
提交标签:
git add .
git commit -m “fixed some bugs”
git tag -a 0.1.3 -m “Release version 0.1.3″
//可以给指定commit打标签,不一定在当前commit打标签
git tag -a v1.2 9fceb02r23r2t5445t45t4 -m "my tag"
git tag 是命令
-a 0.1.3是增加 名为0.1.3的标签
-m 后面跟着的是标签的注释
//git push origin master
git push origin --tags //推送所有tag至服务器
git push origin v1.0 //推送单个tag至服务器
–tags参数表示提交所有tag至服务器端,普通的git push origin master操作不会推送标签到服务器端。
切换标签:
git tag --list // 查看已有tag列表
git show tagname //查看某个tag的详细信息
git checkout [tag/branch/commit]
// 切换到指定tag/branch/commit都是此命令
删除标签:
git tag -d 0.1.3
删除远程标签:
git push origin :refs/tags/0.1.3