Git Tag作用
来源:互联网 发布:淘宝联盟怎么招代理 编辑:程序博客网 时间:2024/06/06 19:14
1.官方解释
Git tag 给当前分支打标签
2. 个人解释
其实道理和commit 的commit-sha1有些相似,其实就是给当前的版本做个标记,以便回退到此版本。如果使用commit-sha1,大家都记不住那条冗长的sha1码,所以用tag标签来做记录
发布一个版本时,我们通常先在版本库中打一个标签(tag)
3.
1) git tag <name>就可以打一个新标签
MacBook-Pro:API_TestCase $ git tag testtag标签都只存储在本地,不会自动推送到远程。
2) 可以用命令git tag查看所有标签:
MacBook-Pro:API_TestCase $ git tagtesttag
3)在历史提交上打 tag
查看commit id,使用commit id打tag
$ git logcommit 88d434eb9992fa7502ec246ecfb89aef19f16873Date: Wed Nov 16 17:54:36 2016 +0800 change for assertcommit 6df3aa614a45e687697a628a9174106822f79bfcDate: Tue Nov 15 17:45:40 2016 +0800 change for V1.7
然后使用commit id
$ git tag v0.9 6df3aa614a45e687697a628a9174106822f79bfc
注意,标签不是按时间顺序列出,而是按字母排序的。可以用git show <tagname>查看标签信息:
$ git show testtagcommit 88d434eb9992fa7502ec246ecfb89aef19f16873Author: ------Date: Wed Nov 16 17:54:36 2016 +0800 change for assert
4)带有说明的标签,用-a指定标签名,-m指定说明文字:
$ git tag -a v0.1 -m "version 1.0" 88d434eb9992fa7502ec246ecfb89aef19f16873
5)删除标签
MacBook-Pro:API_TestCase$ git tag -d testtagDeleted tag 'testtag' (was 88d434e)
6) 推送某个标签到远程,使用命令git push origin <tagname>:
$ git push origin testtag
$ git push origin --tags
0 0
- Git Tag作用
- Git中tag的用法及作用
- git tag
- git tag
- git tag
- git tag
- git tag
- git tag
- git tag
- git tag
- git tag
- Git tag
- git tag
- git tag
- git tag
- git tag
- git tag
- git tag
- 当python超出默认递归次数RecursionError: maximum recursion depth exceeded in comparison
- 时间段内做最多的事
- Storm入门实例之单词计数
- UNIX下的通信
- [php] 让 session 存入 redis 或 memcached 的配置
- Git Tag作用
- ashx和aspx的区别
- mysql架构基础学习
- loadrunner使用教程之IP欺骗
- Centos7 vnc配置
- Presto Facebook 开源的大数据查询引擎
- wordpress建设博客或电商网站之一:安装与配置phpmyadmin
- 欢迎使用CSDN-markdown编辑器
- iOS 代理和block的理解