lygyh9985825 发表于 2018-1-13 12:59:10

[Git]checkout 指定版本

$ git branch  

* consistencyCheck  

master  

# git checkout master  

Switched to branch 'master'  
# git branch
  
   consistencyCheck
  
* master
  
# git checkout HEAD
  
# git log |more
  
commit e24385f84866f0010d3317164b23be9e6054f283
  
Merge: 31d7dc5 41ac93d
  
Author: wa357 <wa6@dd.com>
  
Date:   Wed Apr 26 13:08:11 2017 +0800
  

  
   merge modify_election
  

  
commit 41ac93d383abf2e3b83a2df1cd3c201877867d2d
  
Author: lij <lij@dd.com>
  
Date:   Mon Apr 24 16:00:15 2017 +0800
  

  
       modify the position of calling
  

  
commit 40b81hpc6685c7340106206fa171d0611767d40f93b
  
# git checkout e24385f84866f0010d3317164b23be9e6054f283
  
Note: checking out 'e24385f84866f0010d3317164b23be9e6054f283'.
  

  
You are in 'detached HEAD' state. You can look around, make experimental
  
changes and commit them, and you can discard any commits you make in this
  
state without impacting any branches by performing another checkout.
  

  
If you want to create a new branch to retain commits you create, you may
  
do so (now or later) by using -b with the checkout command again. Example:
  

  
   git checkout -b new_branch_name
  

  
HEAD is now at e24385f... merge modify_election_datanode_algorithm
  
#
  
# git branch
  
* (detached from e24385f)
  
   consistencyCheck
  
   master
页: [1]
查看完整版本: [Git]checkout 指定版本