zoukankan      html  css  js  c++  java
  • 【Gitlab】GIT回滚master分支到指定tag版本 并提交远程仓库

    【Gitlab】GIT回滚master分支到指定tag版本 并提交远程仓库
    1 查看分支
    git branch

    2 切换到master分支
    git checkout master

    3 查看标签
    git tag
    v1.3.3
    v1.3.4
    v1.3.5

    4 查看某个标签的详情
    git show v1.3.5
    commit fb479960c0cec5549463ae123d70bdd72ccf6be7

    5 通过commit id回退
    git reset --hard fb479960c0cec5549463ae123d70bdd72ccf6be7

    6 显示所有提交过的版本信息
    git log

    7 查看所有分支的所有操作记录
    git reflog

    8 显示工作目录和暂存区的状态
    git status

    9 提交远程仓库
    git push origin master

    10 git报错,需要进入gitlab项目设置,protected branches里取消master的protected,设置

    【Gitlab】GIT回滚master分支到指定tag版本 并提交远程仓库
    【Gitlab】GIT回滚master分支到指定tag版本 并提交远程仓库

    11 再次push本地master分支
    git push origin master

    12 加入-f参数,强制提交,远程端将强制跟新到reset版本
    git push -f origin master

    13 版本回退完毕后,在gitlab项目设置,protected branches里设置回master的protected。

  • 相关阅读:
    ado.net
    sql基础
    css样式
    HTML基础加强
    socket网络编程
    网络聊天室
    多线程
    WinForm基础
    使用Maven插件(plugin)MyBatis Generator逆向工程
    SpringBoot使用thymeleaf时候遇到无法渲染问题(404/500)
  • 原文地址:https://www.cnblogs.com/tengrl/p/11382117.html
Copyright © 2011-2022 走看看