zoukankan      html  css  js  c++  java
  • git 版本回滚


    1、克隆代码到本地

    git clone http://qtools@dev.qtoolsbaby.cn:81/gitlab/qtools/jenkins_ceshi.git

    2、git log 查看所有的历史版本

    commit f0f1efe5837ed4bf6209c6152562902565e49f21
    Author: ***  <tch@qtoolsbaby.com>
    Date:   Fri Nov 3 01:26:38 2017 +0800
    
        d
    
    commit 476791f298a14fd03c2fc415ebf79ef80443caed
    Author: ***  <tch@qtoolsbaby.com>
    Date:   Fri Nov 3 01:20:24 2017 +0800
    
        ceshi
    
    commit 9a619ca0d1b3f5f14724075eb2ee84bf083afdb4
    Author:***  <tch@qtoolsbaby.com>
    Date:   Fri Nov 3 01:03:53 2017 +0800
    
        dd
    
    commit 7efddfe4572d43d2e480edee41f7ff5910299e1d
    Author: *** <tch@qtoolsbaby.com>
    Date:   Fri Nov 3 00:57:57 2017 +0800
    
        修改


    git log可以获取到某个历史版本的id,以及代码提交人,利用此id进行回滚,比如f0f1efe5837ed4bf6209c6152562902565e49f21
    3、git reset --hard id

    git reset --hard  f0f1efe5837ed4bf6209c6152562902565e49f21


    id就是git log查看的所要回滚的版本id,这样就可以回滚到自己想要的之前版本

  • 相关阅读:
    新的开始——3.3
    第一个周末——3.2
    恋爱知识大增——周五3.1
    相安无事——周四2.28
    好几天没写了。。。——周三2.27
    开学第二天——2.26
    开学第一天——2.25
    华为
    微软 Microsoft
    谷歌 google
  • 原文地址:https://www.cnblogs.com/tchua/p/7802991.html
Copyright © 2011-2022 走看看