[Git]checkout 指定版本
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 指定版本的更多相关文章
- 使用git checkout 指定git代码库上的指定分支
因为曾经一直是在用svn,到狼厂,大家都用Git. 哥的开发环境:IntelliJ 说说简单的操作过程吧. 1.检出Git代码库 cd到指定文件夹 git clone http://..../andr ...
- git下载指定版本的代码
1. git fetch https://github.com/angular/angular.js.git v1.5.8 或 2. git pull https://github.com/angul ...
- (AOSP)repo checkout指定版本
aosp 怎么切换分支? To properly switch Android version, all you need to change is branch for your manifest ...
- git pull 指定版本
git init git remote add origin git@bitbucket.org:huashiyiqike/lstm-hf.git git pull origin master
- 在 Git 中 Checkout 历史版本
昨天写代码的时候,误删了一个文件.今天发现的时候,commit 已经 push 到版本库了.本想用 git reset 回退版本,找回文件后重新提交.但是想起 Git 是一个版本控制系统哎,直接从版本 ...
- [git] 更新到某个指定版本
[git] 更新到某个指定版本 - Vanquisher - 博客频道 - CSDN.NET [git] 更新到某个指定版本 2015-09-06 09:30 527人阅读 评论(0) ...
- git更新Activemq在远程github上指定版本的源码步骤
第一步:根据地址克隆源码 (activemq-5.9) $ git clone https://github.com/apache/activemq.git 第二步:查看远程源码的版本清单 ( ...
- Git 将代码回到指定版本
将代码回到hash为1fbcb7ea3b43df60c639875d2bb68e20b451059e的版本 git checkout 1fbcb7ea3b43df60c639875d2bb68e20b ...
- [Git] 获取指定的历史版本代码
首先 ,把项目 clone 到其他文件夹下 git clone git@github.com:skyming/BMAdScrollView.git 然后查看指定历史版本 tree 的 SHA chec ...
随机推荐
- Python - Django - 静态文件相关
静态文件的路径设置在 settings.py 中 如果该路径发生更改的话,html 中相关路径也要进行修改 CSS: <link href="/static/dashboard.css ...
- LODOP打印超文本保留背景色带平铺水印
前面的博文:LODOP中设置设置图片平铺水印,超文本透明. 介绍过 ,如果不想去掉超文本的背景色,想在超文本背景色和超文本内容文字之间加上水印,让水印在背景色上面,文字下面,是不行的,因为平铺的图片和 ...
- 批处理&提权命令
提权应用 批处理遍历webshell可访问目录 opendir.readdir.is_dir.is_writable这几个遍历文件夹的函数,在php限制的情况下,找可执行目录就没有优势了. @echo ...
- 以Redis为例介绍YCSB的使用
环境 首先确保安装了jdk和maven,我个人使用的是openjdk11和maven3,由于本人非常建议使用python版本的ycsb,建议安装python.ubuntu 18.04下可以使用apt安 ...
- 第07组 Alpha冲刺(4/4)
队名:秃头小队 组长博客 作业博客 组长徐俊杰 过去两天完成的任务:学习了很多东西 Github签入记录 接下来的计划:继续学习 还剩下哪些任务:后端部分 燃尽图 遇到的困难:自己太菜了 收获和疑问: ...
- canal启动报错ERROR c.a.o.canal.parse.inbound.mysql.dbsync.DirectLogFetcher - I/O error while reading from client socket
- mysql navcat备份使用详解
mysql navcat备份使用详解 点击备份 然后新建备份 然后选择要备份的表 就可以了 以后这个表删除了 内容变更了 都可以点击 还原备份就可以了
- Linux DNS 服务器配置与管理
一.环境介绍: 运行软件:VMware Workstation Pro 14 系统环境:CentOS-7-x86_64-1810 二.操作配置: 1.基础知识简介 (1)域名空间 域和域名: DNS树 ...
- QPS、TPS、PV、UV、GMV、IP、RPS?
QPS.TPS.PV.UV.GMV.IP.RPS QPSQueries Per Second,每秒查询数.每秒能够响应的查询次数. QPS是对一个特定的查询服务器在规定时间内所处理流量多少的衡量标准, ...
- Spring Boot制作启动图案
SpringBoot在启动时会有一个默认图案的,如果不喜欢可以自己制作一个. 在resources的目录下新建banner.txt文件. 制作图案地址:springboot启动图案定制 通过输入字符串 ...