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

mac2022-06-30  27

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

2 切换到master分支git checkout master

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

4 查看某个标签的详情git show v1.3.5commit 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,设置

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

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

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

 

转载于:https://www.cnblogs.com/tengrl/p/11382117.html

相关资源:JAVA上百实例源码以及开源项目
最新回复(0)