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的更多相关文章

  1. git自定义项目钩子和全局钩子

    钩子介绍 自定义钩子分为:项目钩子和全局钩子 自定义全局钩子: 全局钩子目录结构: (注意:excludes目录结构是我们自定义的目录,规则逻辑在update.d/update.py脚本里实现的,非g ...

  2. 探讨 Git 代码托管平台的若干问题

    关于 Git 版本控制软件种类繁多,维基百科收录的最早的版本控制系统是 1972 年贝尔实验室开发的 Source Code Control System.1986 年 Concurrent Vers ...

  3. 探讨 Git 代码托管平台的若干问题 - 2019 版

    关于 Git 版本控制软件种类繁多,维基百科收录的最早的版本控制系统是 1972 年贝尔实验室开发的 Source Code Control System.1986 年 Concurrent Vers ...

  4. 浅谈iOS版本号

    作者:Travis FIR.im 一直在尽量兼容不同使用习惯的版本号形式, 但是在使用中我们发现好多开发者对怎么更好的用版本号来标示应用很陌生. 这是篇基础文章, 简单介绍 iOS 的版本号. 名词解 ...

  5. Tinker爬坑之路

    目的 热修复去年年底出的时候,变成了今年最火的技术之一.依旧记得去年面试的时候统一的MVP,然而今年却变成了RN,热修复.这不得不导致我们需要随时掌握最新的技术.不然可能随时会被淘汰.记得刚进公司,技 ...

  6. CentOS 安装抓包工具wireshark-tshark抓包工具

    原文出处:razeen -> https://razeen.me/post/how-to-install-tshark-on-centos.html 准备在服务器上用tshark抓包,分析一下数 ...

  7. 热修复框架Tinker的从0到集成之路(转)

    转自:http://blog.csdn.net/lisdye2/article/details/54411727 热修复框架Tinker的从0到集成之路 转载请标明出处: http://blog.cs ...

  8. 热修复框架Tinker快速集成

    由于腾讯官方的demo对于刚接触的我来说,太过复杂,找不到核心配置,因此将tinker集成中最核心的东西抽取出来,整合到一个demo中. demo工程已经提交到github上,点击跳转 更多使用方法, ...

  9. GIT和SVN之间的区别及基本操作对比

    1)GIT是分布式的,SVN不是: 这是GIT和其它非分布式的版本控制系统,例如 SVN,CVS等,最核心的区别.如果你能理解这个概念,那么你就已经上手一半了.需要做一点声明,GIT并不是目前第一个或 ...

  10. linux显示git commit id,同时解决insmod模块时版本不一致导致无法加载问题

    linux内核默认会包含git的commit ID. 而linux的内核在insmod模块时,会对模块和内核本身的版本做严格的校验.在开发产品时,改动内核后,由于commit ID变更,会导致linu ...

随机推荐

  1. 为云饰数据库添加Index

    Asset Collection: 1. _id_ 2. CategoryId_1_Date_-1 3. CategoryId_1_Id_1 4. CategoryId_1_Name_1 5. Cat ...

  2. C# 从服务器下载文件代码的几种方法

    一.//TransmitFile实现下载 protected void Button1_Click(object sender, EventArgs e) { /* 微软为Response对象提供了一 ...

  3. 禁止指定目录执行php文件

    我们设置网站权限的时候,有些目录不得不设置让http服务器有写入权限,这样安全隐患就来了.比如discuz x2的 data目录,这个必须要有写入限,论坛才能正常运行,但有的黑客可能就会利用这个目录上 ...

  4. HttpUnit学习笔记

    <!-- htmlUnit --> <dependency> <groupId>net.sourceforge.htmlunit</groupId> & ...

  5. Using jQuery to add a dynamic “Back To Top” floating button with smooth scroll

    Ever read a really long blog post or article and then had to scroll all the way up to the top of the ...

  6. Linux学习1

    Linux中一切皆文件,且不依靠扩展名区分文件,学习Linux必须要熟悉在字符界面进行文件的管理. 首先是Linux的查询命令. (1)ls -a是显示当前目录所有文件,包含隐藏文件,如图中文件名前加 ...

  7. WPF中利用后台代码实现窗口分栏动态改变

    在WPF中实现窗口分栏并能够通过鼠标改变大小已经非常容易,例如将一个GRID分成竖排三栏显示,就可以将GRID先分成5列,其中两个固定列放GridSplitter. <Grid Backgrou ...

  8. [转]JAVA布局模式:GridBagConstraints终极技巧

    最近正在 修改<公交线路查询系统>,做系统的时候都是用NULL布局,由于NULL布局调用windows系统的API,所以生成的程序无法在其他平台上应用,而 且如果控件的数量很多,管理起来也 ...

  9. PAT-乙级-1032. 挖掘机技术哪家强(20)

    1032. 挖掘机技术哪家强(20) 时间限制 200 ms 内存限制 65536 kB 代码长度限制 8000 B 判题程序 Standard 作者 CHEN, Yue 为了用事实说明挖掘机技术到底 ...

  10. About javascript closure

    https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Closures?redirectlocale=en-US&redi ...