zoukankan      html  css  js  c++  java
  • Git 标签管理

    标签类似于快照的功能,可以给版本库打一个标签,记录某个时刻库的状态,也可以随时恢复到该状态

    git tag                # 查看所有标签
    git tag <tag_name>     # 给当前所在的分支打标签
    git show <tag_name>    # 查看指定标签的详细信息
    git tag -d <tag_name>  # 删除指定的标签

    针对分支打标签:

    [root@localhost ~]$ cd /data/git
    [root@localhost git]$ git checkout master    # 切换到需要打标签的分支
    [root@localhost git]$ git tag v1.0           # 给当前所在的分支打标签
    [root@localhost git]$ git show v1.0          # 查看指定标签的详细信息

    针对历史的 commit 信息打标签:

    [root@localhost git]$ git log --pretty=oneline --abbrev-commit         # 查看历史的commit信息
    [root@localhost git]$ git tag -a v4.0 -m 'Merge branch dev' e40937d    # 对指定的commit信息打标签,-m 指定对标签的描述信息

    如何推送或删除标签:

    [root@localhost git]$ git push origin v1.0               # 推送指定的标签到远程
    [root@localhost git]$ git push --tag origin              # 推送所有的标签到远程
    [root@localhost git]$ git tag -d v1.0                    # 删除本地标签
    [root@localhost git]$ git push origin :refs/tags/v1.0    # 删除远程标签

        

  • 相关阅读:
    Spark RDD 创建(一)
    编译Spark-1.6.0源码
    Strom学习笔记一
    Hbase笔记——RowKey设计
    Hbase物理模型
    HDFS分布式文件系统设计思想
    Hbase 基本命令
    内部排序算法
    278. First Bad Version
    266. Palindrome Permutation
  • 原文地址:https://www.cnblogs.com/pzk7788/p/10294219.html
Copyright © 2011-2022 走看看