创建
git tag 标签名
git tag -a 标签名 -m "备注"
git tag 标签名 节点id
查看
## 查看所有标签
git tag
## 模糊匹配
git tag -l "tag_6.7.1_*"
## 标签详情
git show 标签名
删除
git tag -d 标签名
推送
## 推送指定标签
git push origin 标签名
## 将本地所有标签一次性提交到git服务器
git push origin -–tags
动作
切换
## 切换到指定标签节点
git checkout 标签名
Lenovo@DESKTOP-OMKC0JH MINGW64 /d/test/develop/saas-service-impl (develop)
$ git checkout xiaoli
Note: checking out 'xiaoli'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b <new-branch-name>
HEAD is now at 9ef9458 小李:添加了一行代码
Lenovo@DESKTOP-OMKC0JH MINGW64 /d/test/develop/saas-service-impl ((xiaoli))
$ git branch -a
* (HEAD detached at xiaoli)
G3
develop
master
Lenovo@DESKTOP-OMKC0JH MINGW64 /d/test/develop/saas-service-impl ((xiaoli))
$ git commit -m "小风"
[detached HEAD 8300bf4] 小风
1 file changed, 1 insertion(+)
Lenovo@DESKTOP-OMKC0JH MINGW64 /d/test/develop/saas-service-impl ((8300bf4...))
$ git checkout -b xiaofeng
Switched to a new branch 'xiaofeng'
Lenovo@DESKTOP-OMKC0JH MINGW64 /d/test/develop/saas-service-impl (xiaofeng)
$ git branch -a
G3
* develop
master
xiaofeng
网友评论