列出git提交到两个日期之间的master分支 [英] List git commits to master branch between two dates

查看:73
本文介绍了列出git提交到两个日期之间的master分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何获取2014年1月1日至2014年6月30日之间对master分支所做的所有git提交的列表?

How can i get a list of all the git commits done to the master branch between 2014-01-01 and 2014-06-30?

我知道git log会大致为我提供这种格式(所有提交均重复):

I know git log will give me roughly this format (repeated for all commits):

commit <hash>
author: <author name>
date: <date>
<comment>

但是如何将其限制为选定的日期,并且每种提交格式只限一行?

But how can it be limited to selected dates and a one line per commit format?

<hash> <author> <date>
<hash> <author> <date>

推荐答案

$ git log --since "DEC 1 2014" --until "DEC 5 2014" --pretty=format:"%h %an %ad"

这将提供您想要的2014年12月1日至2014年12月5日之间提交的格式,您可以根据需要更改日期

This will give the format you want for the commits between dec 1 2014 and dec 5 2014, you can change the dates as you like

如果您希望更改格式,可以在此处了解有关选项的信息

If you wish to change the format, you can read about the options here

这篇关于列出git提交到两个日期之间的master分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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