tag

作者: Joy_hu | 来源:发表于2019-06-11 09:44 被阅读0次
    1. 列出tag
      git tag 列出所有tags
      git tag -l tag名字正则 列出单个tag信息
      git show <tag> 显示指定tag信息

    2. push一个tag到remote
      git push origin <tag> 一个一次
      git push origin --tags 所有一次

    3. 删除tag
      git tag -d <tag> 本地删除
      git push origin <remote> :refs/tags/<tag> 推送到远端

    4. checkout一个tag分支
      git fetch --all # Update the local git repo with the latest tags from all remotes
      git checkout tags/<tag> -b <branch> # checkout the specific tag

    5. 打tag
      git tag -a <tag> -m <message> -a 是附注标签的意思,因为除此之外有个轻量标签
      git tag -a tabName <commit hashcode> 为已经存在的branch打tag

    6. bug fix (当前部署的branch是v1.0.0版本,但是有bug需要fix)

    1. 基于当前的v1.0.0版本拉两个分支git checkout tags/<tag> -b <branch>:一个用于打tag叫branch-tag(改了bug之后), 一个用于改bug叫branch-bug
    2. 改完之后将branch-bug push到远端,并合入branch-tag
    3. 合完之后,pull一把本地的branch-tag 获取到最新的bug改动(改动是最新了,但是还没有打tag)
    4. 在branch-tag上打一个tag v1.0.1,push tag到远端。
    5. 在server上git fetch --all 然后git checkout v1.0.1, 已经是最新的改了bug之后的branch了
    6. 部署即可

    相关文章

      网友评论

          本文标题:tag

          本文链接:https://www.haomeiwen.com/subject/nskffctx.html