git rev-list 和 git rev-parse
git-rev-list - Lists commit objects in reverse chronological order
https://git-scm.com/docs/git-rev-list
按照时间顺序倒序排列的commit
Update: If all you need is a commit count, and you're running a newer version of git, you can use the following command:
git rev-list HEAD --count
https://github.com/chucklu/LeetCode
有master和temp两个分支,他们的共同父结点为
SHA-1: 67d9d91064128452ae40183b39aa29a0ed67a7de
获取temp上的结点,以下结点按照时间倒序
$ git rev-list master..temp
f70bf4500daca0f0e1f75fc37a8a672ac730dc98
a4599512bcb46c2f28849a591becd321ee41fcec
2eec4dac0d46b74e130a5c4a3d5fc6f4882823af
9c1580715a078217b1eab6dd8a9dba0f05f387cc
获取master上的结点
$ git rev-list temp..master
31cd5ef6f068c46222fe185870c09c959dd7113e
6925ba40d15b07b66ed44700a62492576447992f
b43d2be8e481841bdc5a6f499fc202b18853b0a0
61297782d9fb28beac0c4bb7aa9b8cacf9db9c63
09f1b97c7474907ebba0c61cc605ecf22cebe27a
ec5dd1be93b5afb21b185310e52630a4f91544d0
aff4fd835d128dd33dc8188f82537d4aa1512895
获取共同父结点之外的结点 也是按照时间倒序,会是乱序的
$ git rev-list temp...master
31cd5ef6f068c46222fe185870c09c959dd7113e
6925ba40d15b07b66ed44700a62492576447992f
b43d2be8e481841bdc5a6f499fc202b18853b0a0
f70bf4500daca0f0e1f75fc37a8a672ac730dc98
a4599512bcb46c2f28849a591becd321ee41fcec
2eec4dac0d46b74e130a5c4a3d5fc6f4882823af
9c1580715a078217b1eab6dd8a9dba0f05f387cc
61297782d9fb28beac0c4bb7aa9b8cacf9db9c63
09f1b97c7474907ebba0c61cc605ecf22cebe27a
ec5dd1be93b5afb21b185310e52630a4f91544d0
aff4fd835d128dd33dc8188f82537d4aa1512895
git rev-parse
https://git-scm.com/docs/git-rev-parse
Dotted Range Notations
- The .. (two-dot) Range Notation
-
The ^r1 r2 set operation appears so often that there is a shorthand for it. When you have two commits r1 and r2 (named according to the syntax explained in SPECIFYING REVISIONS above), you can ask for commits that are reachable from r2 excluding those that are reachable from r1 by ^r1 r2 and it can be written as r1..r2.
- The … (three-dot) Symmetric Difference Notation
-
A similar notation r1...r2 is called symmetric difference of r1 and r2 and is defined as r1 r2 --not $(git merge-base --all r1 r2). It is the set of commits that are reachable from either one of r1 (left side) or r2 (right side) but not from both.
In these two shorthand notations, you can omit one end and let it default to HEAD. For example, origin.. is a shorthand for origin..HEAD and asks "What did I do since I forked from the origin branch?" Similarly, ..origin is a shorthand for HEAD..origin and asks "What did the origin do since I forked from them?" Note that .. would mean HEAD..HEAD which is an empty range that is both reachable and unreachable from HEAD.
git rev-list 和 git rev-parse的更多相关文章
- Git详解之八 Git与其他系统
以下内容转载自:http://www.open-open.com/lib/view/open1328070454218.html Git 与其他系统 世界不是完美的.大多数时候,将所有接触到的项目全部 ...
- git 入门教程之 git bash 竟然不支持 tree 命令
开门见山 git bash 是 Windows 用户安装 git 时默认安装的命令行工具,不仅界面漂亮功能也不错,大多数情况下可以替代 Windows 原生的 cmd 命令行. 然而,git bash ...
- Git 进阶指南(git ssh keys / reset / rebase / alias / tag / submodule )
在掌握了基础的 Git 使用 之后,可能会遇到一些常见的问题.以下是猫哥筛选总结的部分常见问题,分享给各位朋友,掌握了这些问题的中的要点之后,git 进阶也就完成了,它包含以下部分: 如何修改 ori ...
- git diff 生成patch, git apply patch 打补丁方法说明,以及分支管理的简单操作。
git diff 简易操作说明 先git log 查看commit ID, 记录你想要打的补丁的ID 比如说: git log commit 4ff35d800fa62123a28b7bda2a04e ...
- git: fatal: Not a git repository (or any of the parent directories): .git
在看书 FlaskWeb开发:基于Python的Web应用开发实战 时,下载完源码后 git clone https://github.com/miguelgrinberg/flasky.git 试着 ...
- 深入理解git,从研究git目录开始
转发学习的啦. 似乎很少有人在读某个git快速教程的时候会说:“这个关于git的快速教程太酷了!读完了用起git来超级舒服,并且我一点也不怕自己会破坏什么东西.” 对git的初学者来说,刚接触git时 ...
- Git详解之三 Git分支
相关文档 — 更多 Git 基础培训.ppt GIT 使用经验.ppt GIT 介绍.pptx GIT 分支管理是一门艺术.docx Eclipse上GIT插件EGIT使用手册.docx git/gi ...
- [git]添加项目到git
写在前面 一直在想把代码托管到git上面,一直没有去研究,最近发现自己写的demo,好多都找不到了,实在是没办法了,耐下心研究了下git.这里通过添加了自己做的demo,算是也是学习下git的操作吧. ...
- git使用命令, 特别:git checkout -b a 与 git branch a区别
摘自: https://my.oschina.net/u/587974/blog/74341 创建分支: $ git branch mybranch 切换分支: $ git checkout mybr ...
- 将在本地创建的Git仓库push到Git@OSC
引用自:http://my.oschina.net/flan/blog/162189 在使用git 处理对android的修改的过程之中总结的.但不完善 Git push $ git push ori ...
随机推荐
- 词典对象(NSDictionary和NSMutableDictionary)
词典(dictionary)顾名思义就是同由键-值组成的数据集合.与在词典中查找单词定义一样,可以通过对象的键从词典中获取需要的对象,看到 这里,你是不是想起了java中的map?和NSArray一样 ...
- K-L变换
K-L变换( Karhunen-Loeve Transform)是建立在统计特性基础上的一种变换,有的文献也称为霍特林(Hotelling)变换,因他在1933年最先给出将离散信号变换成一串不相关系数 ...
- 【翻译自mos文章】检查$ORACLE_HOME是否是RAC的HOME的方法以及relink RAC的Oracle binary的方法
检查$ORACLE_HOME是否是RAC的HOME的方法以及relink RAC的Oracle binary的方法 来源于: How to Check Whether Oracle Binary/In ...
- 22. Spring Boot 拦截器HandlerInterceptor【从零开始学Spring Boot】
转:http://blog.csdn.net/linxingliang/article/details/52069495 上一篇对过滤器的定义做了说明,也比较简单.过滤器属于Servlet范畴的API ...
- Git以及github的使用方法(六),管理修改
现在,假定你已经完全掌握了暂存区的概念.下面,我们要讨论的就是,为什么Git比其他版本控制系统设计得优秀,因为Git跟踪并管理的是修改,而非文件. 你会问,什么是修改?比如你新增了一行,这就是一个修改 ...
- nload 命令
网卡 流量监控命令 // 安装 yum intall nload nload 上下page 键 切换网卡查看
- 通过jstl判断是否给value 赋值
<input type="text" name="saler.password" id="password" value=" ...
- STL之set具体解释(二)
首先来看看set集合容器: set集合容器实现了红黑树的平衡二叉树数据结构.在插入元素时它会自己主动调整二叉树的排列,把该元素放到适当的位置,而且 保证左右子树平衡.平衡二叉检索树採用中序遍历算法. ...
- C语言函数的递归和调用
函数记住两点: (1)每个函数运行完才会返回调用它的函数:每个函数运行完才会返回调用它的函数,因此,你可以先看看这个函数不自我调用的条件,也就是fun()中if条件不成立的时候,对吧,不成立的时候就是 ...
- node开发后将本地mysql数据导入到服务器mysql
近期写的一个钉钉企业微应用用到了mysql数据库(用koa写的后台,并用mysql库来连接),现在需要把本地数据库的数据导入到服务器的数据库中. 服务器安装mysql 可以google篇centos的 ...