find commit by hash sha in git

问题:

I need to find a commit in Git by given hash SHA. For example, if I have "a2c25061" hash, and I need to get the author and the committer of this commit.

What is the command to get that?

回答:

Just use the following command

git show a2c25061

举例:

supersocket中v1.6分支上,查找5db9e34

Administrator@LuJunTao MINGW64 /d/SourceCode/SuperSocket (demo|REBASE 1/6)
$ git show 5db9e34
commit 5db9e3407123bfb7a377dba59cb47748b37cef25
Author: Kerry Jiang <kerry-jiang@hotmail.com>
Date: Wed Aug 19 23:50:28 2015 +0800

fixed the bug m_CurrentSourceCount was not updated in SmartPool

diff --git a/Common/SmartPool.cs b/Common/SmartPool.cs
index 2b01ea2..639456f 100644
--- a/Common/SmartPool.cs
+++ b/Common/SmartPool.cs
@@ -332,7 +332,7 @@ namespace SuperSocket.Common
var newItemsCount = Math.Min(m_TotalItemsCount, m_MaxPoolSize - m_TotalItemsCount);

T[] items;
- m_ItemsSource[m_CurrentSourceCount] = m_SourceCreator.Create(newItemsCount, out items);
+ m_ItemsSource[m_CurrentSourceCount++] = m_SourceCreator.Create(newItemsCount, out items);

m_TotalItemsCount += newItemsCount;

git show显示的时间,标明了时区。

tortoisegit在日志中显示的时候,直接转换成了LocalTime

将git show的内容直接导出到文件中

git show f258 >./f258.txt      将文件导出到当前目录下的f258.txt文件中

根据指定的commit查找对应的log的更多相关文章

  1. linux find-在指定目录下查找文件

    推荐:更多Linux 文件查找和比较 命令关注:linux命令大全 find命令用来在指定目录下查找文件.任何位于参数之前的字符串都将被视为欲查找的目录名.如果使用该命令时,不设置任何参数,则find ...

  2. git合并分支上指定的commit

    merge 能够胜任平常大部分的合并需求.但也会遇到某些特殊的情况,例如正在开发一个新的功能,线上说有一个紧急的bug要修复.bug修好了但并不像把仍在开发的新功能代码也提交到线上去.这时候也许想要一 ...

  3. python 指定字符串位置查找

    指定字符串位置查找 #指定字符查找 s = 'F:/my_pycharm/pycharm_project/CSV表格/10.csv' print(s.find('/')) # 2, 第一个/在2位置 ...

  4. Commit message 和 Change log 编写指南

    来源:http://www.ruanyifeng.com/blog/2016/01/commit_message_change_log.html Git 每次提交代码,都要写 Commit messa ...

  5. Git回滚到指定的commit

    查看历史commint $ git log (可以记下sha码) 回退命令: $ git reset --hard HEAD^ 回退到上个版本$ git reset --hard HEAD~3 回退到 ...

  6. [Practical Git] Filter commit history with git log arguments

    In the last lesson, we learned how to format the git log output; in this lesson we will learn how to ...

  7. [Practical Git] Format commit history with git log arguments

    When running the git log command, we can pass in options as arguments toformat the data shown for ea ...

  8. 如何指定vim 的查找是从上往下还是从下往上[z]

    vim 搜索可以是 / 或者 ?,前者是往下找,后者是往前找. 用 n 查找下一个的时候,就和这两个指令指定的方向相同.如果你想改变方向的话,比如想往下找,那么 / 完了直接回车就行了.表示再次使用上 ...

  9. 利用grep命令查找字符串分析log文件的一次实践

    需求场景: 我需要分析一个服务器访问日志,分析百度蜘蛛这个月对求索网页面的抓取情况. 分析问题: 我的一个access.log文件大小有35M,不可能直接通过打开查看.我需要过滤掉一些没有的信息,只保 ...

随机推荐

  1. php安全模式

    http://www.cnblogs.com/samson/archive/2011/08/08/2130550.html php安全模式:safe_mode=on|off启用safe_mode指令将 ...

  2. dumpbin工具的使用

    当我们需要查看一个dll或exe文件中的包含的函数或是依赖的函数之类的信息,可以使用Visual Studio自带的工具dumpbin来实现,使用方法为: 1/ 启动Visual Studio 命令行 ...

  3. ios8地图开发的报错

    报错如下:Trying to start MapKit location updates without prompting for location authorization. Must call ...

  4. HTML<label> 标签的 for 属性

    定义和用法 for 属性规定 label 与哪个表单元素绑定. 隐式和显式的联系 标记通常以下面两种方式中的一种来和表单控件相联系:将表单控件作为标记标签的内容,这样的就是隐式形式,或者为 <l ...

  5. Spring配置,JDBC数据源及事务

    <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.sp ...

  6. HDU 4628 Pieces(DP + 状态压缩)

    Pieces 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4628 题目大意:给定一个字符串s,如果子序列中有回文,可以一步删除掉它,求把整个序列删除 ...

  7. bzoj2732: [HNOI2012]射箭 半平面交

    这题乍一看与半平面交并没有什么卵联系,然而每个靶子都可以转化为两个半平面. scanf("%lf%lf%lf",&x,&ymin,&ymax); 于是乎就有 ...

  8. ci验证码

    ci 之验证码 为了方便,把 system/system/helpers/captcha_helper.php复制放在 application/helpers/文件夹里面 手册上面推荐用数据库,但个人 ...

  9. rgba兼容IE系列

    在容器里面如果用到opacity或者filter:opacity里面的内容也会被滤镜化 如果不想里面的内容也被滤镜化我们可以用rgba来处理或者用透明的背景图片. 兼容ie的rgba的写法 backg ...

  10. PHP中的预定义超全局数组

    定义 超全局变量,是在全部作用域中始终可用的内置变量. PHP中的许多预定义变量都是"超全局的",这意味着它们在一个脚本的全部作用域中都可用. 在函数或方法中无需执行 global ...