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 ...
随机推荐
- cmake使用(CMakeList.txt)
set(CMAKE_INCLUDE_CURRENT_DIR ON)#CMAKE_INCLUDE_CURRENT_DIR equal to INCLUDE_DIRECTORY(${CMAKE_CURRE ...
- k8s入门简介
1.docker的三种编排工具 Docker的第一类编排工具: a.docker compose(docker原生):只能对一个主机上的容器进行编排,无法编排多个主机上的容器; b.docker sw ...
- eclipse默认配色(内含恢复文件和恢复方法)
转载:http://blog.csdn.net/w174504744/article/details/8672679 很多搞开发的同学一开始不喜欢默认的eclipse白底配色,去网上千辛万苦搜到了很多 ...
- ios 使用keychain具体方法
Dictionary 写入: if ([self.currentUserAccount length] > 0) { Keycha ...
- Android handler 内存泄露分析及解决方法
1. 什么是内存泄露? Java使用有向图机制,通过GC自动检查内存中的对象(什么时候检查由虚拟机决定),如果GC发现一个或一组对象为不可到达状态,则将该对象从内存中回收.也就是说,一个对象不被任何引 ...
- 自己封装的CMusic类 【转】
http://www.cnblogs.com/zhangminaxiang/archive/2013/02/27/2936011.html 缘由: 在改正俄罗斯方块程序的功能的时候,想给这个程序增加一 ...
- php自己编译安装后,再给这个编译安装的php版本添加拓展模块的处理办法。
原文: https://www.cnblogs.com/zongyl/p/5924627.html 说明,给编译安装之后的php 添加pgsql 拓展成功. --------------------- ...
- 使用 rman duplicate from active database 搭建dataguard 手记--系列二
run { allocate channel prmy1 type disk; allocate channel prmy2 type disk; allocate channel prmy3 typ ...
- hdu5340 Three Palindromes(manacher算法)
题目描写叙述: 推断能否将字符串S分成三段非空回文串. 解题思路: 源码: #include <cstdio> #include <algorithm> #define MAX ...
- odoo 的时差 坑
很多人掉进了odoo的时间坑 odoo约定关于日期的数据,存放在数据库时,以 utc0 时区也就是不带时区 存放,应用程序读取日期展示日期时, 转换成用户的时区展示 例如,stock ...