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


    常用命令:

    • 查看所有标签:git tag

    • 创建标签:
      (-a和-m可选)

      • git tag 标签名
      • 指定提交信息:git tag -a 标签名 -m "提交信息"
      • 给指定commit id添加标签:git tag 标签名 指定的commit的id
    • 删除标签:git tag -d 标签名

    • 标签发布:git push origin 标签名

      (origin为你在本地给远程仓库的名字(即git remote add命令后的名字))

    步骤:

    1. 新建标签

    查看所有标签:git tag

    新建标签:git tag 标签名(也可以用命令:git tag -a 标签名 -m "提交信息")

    2. 新建好的标签只在本地仓库而已,(标注的是创建该标签前的最新一次commit):git push origin 标签名(origin为你在本地给远程仓库的名字(即 git remote add命令后的名字))

    (所以一般我们回滚的时候,都是直接用标签,而无需用git log查看日志再找到commit id)

    3. 也可以给指定的commit id添加标签(上面命令只能给最新的commit添加标签而已)

    然后,和步骤2一样,push到远程仓库。

    4. 若想删除标签:git tag -d 标签名

  • 相关阅读:
    hdoj:2075
    hdoj:2072
    hdoj:2071
    hdoj:2070
    hdoj:2069
    test001
    hdoj:2067
    hdoj:2061
    hdoj:2058
    hdoj:2057
  • 原文地址:https://www.cnblogs.com/duduwy/p/13418660.html
Copyright © 2011-2022 走看看