Gitlab之版本回滾


  gitlab提交錯誤需要回滾版本

  首先查看log找到需要回滾的head

 git log

  回滾

git reset --hard 297ff2dcf20605297684f296a4b4ccaa1cf4dc48

  強制提交

git push -f origin master

  強制提交報錯

[root@prod-zabbix hope-framework]# git push -f origin master
Username for 'http://192.168.1.193': root
Password for 'http://root@192.168.1.193': 
Total 0 (delta 0), reused 0 (delta 0)
remote: GitLab: You are not allowed to force push code to a protected branch on this project.
To http://192.168.1.193/hope/hope-framework.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: 無法推送一些引用到 'http://192.168.1.193/hope/hope-framework.git'

  master默認分支是保護狀態取消分支保護即可提交

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM