标签Tag
Git中标签有两类:
- lightweight: just a pointer to a specific commit
- annotated
Annotated Tags
使用-a
:1
git tag -a v1.4 -m "My version 1.4"
Lightweight Tags
1 | git tag v1.4 |
查看Tag
查看有哪些tag:
1 | git tag |
查看某个tag的信息:
1 | git show v1.4 |
Push
Push命令不会自动把Tag信息包含,需要自己制定1
2git push origin v1.5
git push origin --tags // 所有的tags
Checkout
需要新建一个新的branch,然后指定tag:1
2git checkout -b [branchname] [tagname]
git checkout -b version2 v2.0.0