通用版项目衍生出业务向的项目,交付时提供了专属的
edu分支,不过仍然可以创建一个git tag方便后续追溯,及运维部署。
1.查看
git tag
查看分支的详细情况使用 git show {标签名称}
Gitlab在Repository下的Tags中查看标签列表。
2.创建
git tag -a {标签名称} -m "{描述/备注}"
标签分为轻量标签(lightweight)与附注标签(annotated),轻量标签不要加-a -m,只提供标签名称。
还可以对历史提交打标签:
git log -a {标签名称} {Commit ID}
3.使用方法

git clone {项目} {目录}
cd {目录}
git checkout {标签名称}
此时不能进行更改,依次一般只用于部署,同时也简化 Commit Id 记录的问题。参考这里可以尝试更改代码进行开发,但是既然可以 git clone 没必要进行这样的操作。
4.删除
git tag -d {标签名称}
这一命令只删除本地的tag,执行 git fetch 时又会从远程同步回来,删除远程标签的方法是 git push origin :refs/tags/{标签名称} 但出现如下提示 remote: GitLab: You are not allowed to change existing tags on this project 暂时忽略。