gitlab 遠程倉庫回退到指定版本


參考的這個博客
https://blog.csdn.net/qq_37143673/article/details/85258947

step1:查看提交記錄,獲得版本號

git log
commit 36cc122f5a2218d2b2d4109593a4ec5de589f807
Author: yhl <xxx.com>
Date:   Thu Sep 23 09:51:54 2021 +0800

    ignore

commit 203738c9ccad7d95b728c8d9d287f2ff24eaaca2
Author: chen1234520 <xxx.com.cn>
Date:   Wed Sep 22 18:14:18 2021 +0800

    更新頭文件路徑

commit a9b26683996b88c2bb87cff9cc1bdae38b9c5708
Author: chen1234520 <xxx.com.cn>
Date:   Wed Sep 22 17:30:07 2021 +0800

    上傳測試樣例圖

commit后面的一串數字就是版本號

step2:本地回退到相應的版本

git reset --hard <版本號>

git reset --hard 203738c9ccad7d95b728c8d9d287f2ff24eaaca2

step3:遠程倉庫也退到相應的版本

git push origin <分支名> --force

git push origin master --force


免責聲明!

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



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