Task:知道commit号,如何checkout 指定版本

1. 切换到master: git checkout master

2. 下载最新代码:  git pull

3. 下载head: git checkout HEAD

4. 查看log找到需要的版本: git log

5. 根据header checkout : git checkout XXXXXX

 [root@hpc66- ebs]$ git branch
* consistencyCheck
master
[root@hpc66- ebs]# git checkout master
Switched to branch 'master'
[root@hpc66- ebs]# git branch
consistencyCheck
* master
[root@hpc66- ebs]# git checkout HEAD
[root@hpc66- ebs]# git log |more
commit e24385f84866f0010d3317164b23be9e6054f283
Merge: 31d7dc5 41ac93d
Author: wa357 <wa6@dd.com>
Date: Wed Apr :: + merge modify_election commit 41ac93d383abf2e3b83a2df1cd3c201877867d2d
Author: lij <lij@dd.com>
Date: Mon Apr :: + modify the position of calling commit 40b81hpc6685c7340106206fa171d0611767d40f93b
[root@hpc66- ebs]# 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
[root@hpc66- ebs]#
[root@hpc66- ebs]# git branch
* (detached from e24385f)
consistencyCheck
master

check out 指定的branch

 git clone git@git.com:XXXX.git
git branch
git branch -a //查看历史
git branch -d dev //删除本地分支
git checkout -b dev origin/dev //checkout 远程
git log //查看日志

[Git]checkout 指定版本的更多相关文章

  1. 使用git checkout 指定git代码库上的指定分支

    因为曾经一直是在用svn,到狼厂,大家都用Git. 哥的开发环境:IntelliJ 说说简单的操作过程吧. 1.检出Git代码库 cd到指定文件夹 git clone http://..../andr ...

  2. git下载指定版本的代码

    1. git fetch https://github.com/angular/angular.js.git v1.5.8 或 2. git pull https://github.com/angul ...

  3. (AOSP)repo checkout指定版本

    aosp 怎么切换分支? To properly switch Android version, all you need to change is branch for your manifest ...

  4. git pull 指定版本

    git init git remote add origin git@bitbucket.org:huashiyiqike/lstm-hf.git git pull origin master

  5. 在 Git 中 Checkout 历史版本

    昨天写代码的时候,误删了一个文件.今天发现的时候,commit 已经 push 到版本库了.本想用 git reset 回退版本,找回文件后重新提交.但是想起 Git 是一个版本控制系统哎,直接从版本 ...

  6. [git] 更新到某个指定版本

    [git] 更新到某个指定版本 - Vanquisher - 博客频道 - CSDN.NET     [git] 更新到某个指定版本    2015-09-06 09:30 527人阅读 评论(0) ...

  7. git更新Activemq在远程github上指定版本的源码步骤

    第一步:根据地址克隆源码 (activemq-5.9) $  git  clone   https://github.com/apache/activemq.git 第二步:查看远程源码的版本清单 ( ...

  8. Git 将代码回到指定版本

    将代码回到hash为1fbcb7ea3b43df60c639875d2bb68e20b451059e的版本 git checkout 1fbcb7ea3b43df60c639875d2bb68e20b ...

  9. [Git] 获取指定的历史版本代码

    首先 ,把项目 clone 到其他文件夹下 git clone git@github.com:skyming/BMAdScrollView.git 然后查看指定历史版本 tree 的 SHA chec ...

随机推荐

  1. 如何固定table表格宽度,样式不受容器影响

    之前有篇关于LODOP打印超文本表格,两个样式相同的表格,出现错位的情况.该博文地址:LODOP打印表格错位的几种情况该文试验了两种现象,第一种浏览器页面显示错位,打印预览也错位,第二种浏览器页面表格 ...

  2. Linq中demo,用力看看吧

    本文导读:LINQ to SQL全称基于关系数据的.NET语言集成查询,用于以对象形式管理关系数据,并提供了丰富的查询功能.Linq中where查询与SQL命令中的Where作用相似,都是起到范围限定 ...

  3. 个人博客搭建全记录(Hexo,Github)

    搭建过程主要借鉴小歪的博客 博客主题airclod Hexo,Github建站记录 1. 准备 Github账号 注册登陆Github 创建Repository,Repository Name就是Yo ...

  4. BP神经网络设计常用的基本方法和实用技术

    尽管神经网络的研究和应用已经取得巨大成功,但在网络的开发设计方面至今仍没有一套完善的理论做指导,应用中采取的主要设计方法是,在充分了解待解决问题的基础上将经验与试探相结合,通过多次改进性试验,最终选出 ...

  5. NLP | 算法 学习资料整理

    UPDATE TIME: 2019-12-12 17:06:32 NLP: 对话系统: [ ] https://www.cnblogs.com/jiangxinyang/p/10789512.html ...

  6. Android模拟器Genymotion安装使用教程详解

    一.注册\登录 打开Genymotion官网,https://www.genymotion.com/ ,首先点击右上角的Sign in进行登录操作.如何登录就不细讲了,下面讲一下如何注册(备注:注册按 ...

  7. FutureTask源码阅读

    FutureTask功能用法 类结构 源码中详细说明了FutureTask生命周期状态及变化 /** * The run state of this task, initially NEW. The ...

  8. code and dataset resources of computer vision

    From:http://rogerioferis.com/VisualRecognitionAndSearch2014/Resources.html Source Code Non-exhaustiv ...

  9. CentOS7 Python3下安装 TensorToolbox 1.0.22时的一些错误及解决办法

    CentOS7 Python3下安装 TensorToolbox 1.0.22 (python3) [jiangshan@localhost ~]$ pip install TensorToolbox ...

  10. SSM整合-配置文件

    使用工具:maven.idea.jdk8.mysql.tomcat9.0 初学ssm框架,配置文件的配置目录:                                     其中genera ...