![](/img/trans.png)
[英]How can I get a list of all merge commits to a git branch between two dates?
[英]List git commits to master branch between two dates
如何獲取 2014-01-01 和 2014-06-30 之間對 master 分支所做的所有 git 提交的列表?
我知道git log
會給我大致這種格式(對所有提交重復):
commit <hash>
author: <author name>
date: <date>
<comment>
但是如何將其限制為選定的日期和每個提交格式的一行呢?
<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 日之間提交所需的格式,您可以根據需要更改日期
如果您想更改格式,可以在此處閱讀有關選項的信息
$ git log master --pretty="%h %an %ad" --since=2014-01-01 --until=2014-06-30
你有沒有嘗試過
git whatchanged --since="2 year ago" --until="1 year ago" [--author="NAME_OF_THE_AUTHOR"]
甚至git log
也可以用來得到這個結果。 git log
有一些高級選項可用
git log --after="2014-7-1" --before="2014-7-4"
有關高級 git log 的更多詳細信息,您可以參考此鏈接
好吧,這應該可以解決問題:
git log --oneline --since="1/1/2014" --until="30/6/2014"
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.