Laser
Laser

Reputation: 6960

Git log before some commit date

I'm trying to get all commits before some date from AOSP (android open source project).
I found that I can do it by git command:
git log --before="2011-12-01"

But it shows me only author date (date when patch or change was uploaded buy not merged/changed)

Also I found that I can get date which I need by next git command:
git log --pretty=format:"%cd"
I't will show commit date.

And the question is:
how can get git log before some commit date?

Upvotes: 28

Views: 21417

Answers (1)

VonC
VonC

Reputation: 1328272

Simply combine the two:

git log --before="2011-12-01" --pretty=format:"%cd"

As shown in "Git log: filter by commit's author date", git log filters by commit date, and the pretty=format will display just that.

From the man page:

Using more options generally further limits the output (e.g. --since=<date1> limits to commits newer than <date1>)

Upvotes: 35

Related Questions