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. 一个transaction异常的处理

    11-16 14:13:47.715: W/dalvikvm(16771): threadid=1: thread exiting with uncaught exception (group=0x4 ...

  2. Linux搭建SSH服务器

    Linux 远程登录服务:ssh ·SSH是标准的网络协议,可用于大多数UNIX操作系统,能够实现字符界面的远程登录管理,它默认使用22号端口,采用密文的形式在网络中传输数据,相对于通过明文传输的Te ...

  3. IOS开发中针对UIImageView的几种常用手势

    // //  ViewController.m //  05-手势 // //  Created by wanghy on 15/9/21. //  Copyright (c) 2015年 wangh ...

  4. RS485接线 - 为什么要给2线制RS485接3根线?

    http://www.chipkin.com/rs485-cables-why-you-need-3-wires-for-2-two-wire-rs485/ RS485needs 3 conducto ...

  5. PHP学习笔记(五)

    关于Response header 的一些小知识: Host :address url,  host 是浏览器给服务器提供的address标识.由于http协议是无状态的,服务器需要根据host的这个 ...

  6. javascript dom编程艺术笔记之图片库的改进

    dom的操作要遵守的原则 1.平稳退化 2.分离javascript 3.向后兼容 4.性能考虑 改进后的显示图片方法 function showpic(whichpic){ if(!document ...

  7. ERROR 1045 (28000): Access denied for user 'root'@'localhost'

    # /etc/init.d/mysql stop# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &# mysq ...

  8. 无责任共享 Coursera、Udacity 等课程视频

    本文转载自网络,原作者不详. (本文是用 markdown 写的,访问 https://www.zybuluo.com/illuz/note/71868 获得更佳体验) 程序语言 interactiv ...

  9. 日期字符串转换为NSDate

    // 纯数字日期 NSString *str1 = "; // 日期字符串 NSString *str2 = @"2015/05/12 10:22:01"; // 带时区 ...

  10. mod_wsgi

    配置: WSGIScriptAlias /var/www/wsgi-scripts/simple.wsgi def application(environ, start_response): outp ...