git log中包含作者和日期的最短输出 [英] The shortest possible output from git log containing author and date

查看:230
本文介绍了git log中包含作者和日期的最短输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  * author 
*我怎样才能显示一个git log输出提交日期
*更改

我希望它每个日志条目压缩到一行。什么是最短的格式呢?



(试过 - format = oneline 但是不显示日期)

解决方案

git log --pretty = format:%h%x09%an%x09% ad%x09%s



完成了这项工作。这输出:

  fbc3503 mads Thu Dec 4 07:43:27 2008 +0000显示手机如果手机为空... 
ec36490 jesper Wed Nov 26 05:41:37 2008 +0000 [942]之后清理:使用timezon
ae62afd tobias星期二11月25日21:42:55 2008+0000固定#67加入时区supp
164be7e mads星期二11月25日19:56:43 2008+0000固定测试,和一个'无休止的appoi
93f1526 jesper星期二11月25日09:45:56 2008+0000增加time.ZONE.now作为时区
2f0f8c1 tobias星期二十一月25 03:07:02 2008 +0000在环境中配置的时区
a33c1dc jesper星期二十一月25 01:26:18 2008+0000更新到最新的will_pagina

受到启发 stackoverflow问题:git log输出像svn ls -v,我发现我可以添加我需要的确切参数。

顺便说一句,有没有办法缩短日期不显示时间?
UPDATE:是的,如下面的例子knittl所示:use - date = short


How can I show a git log output with (at least) this information:

* author
* commit date
* change

I want it compressed to one line per log entry. What's the shortest possible format for that?

(tried --format=oneline but that does not show the date)

解决方案

git log --pretty=format:"%h%x09%an%x09%ad%x09%s"

did the job. This outputs:

  fbc3503 mads    Thu Dec 4 07:43:27 2008 +0000   show mobile if phone is null...   
  ec36490 jesper  Wed Nov 26 05:41:37 2008 +0000  Cleanup after [942]: Using timezon
  ae62afd tobias  Tue Nov 25 21:42:55 2008 +0000  Fixed #67 by adding time zone supp
  164be7e mads    Tue Nov 25 19:56:43 2008 +0000  fixed tests, and a 'unending appoi
  93f1526 jesper  Tue Nov 25 09:45:56 2008 +0000  adding time.ZONE.now as time zone 
  2f0f8c1 tobias  Tue Nov 25 03:07:02 2008 +0000  Timezone configured in environment
  a33c1dc jesper  Tue Nov 25 01:26:18 2008 +0000  updated to most recent will_pagina

Inspired by stackoverflow question: "git log output like svn ls -v", i found out that I could add the exact params I needed.

BTW, is there a way to shorten the date by not showing the time? UPDATE: yes, as shown in example by "knittl" below: use --date=short

这篇关于git log中包含作者和日期的最短输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆