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
?
By default, with no arguments, git log lists the commits made in that repository in reverse chronological order; that is, the most recent commits show up first. As you can see, this command lists each commit with its SHA-1 checksum, the author's name and email, the date written, and the commit message.
All that you have to do is go on to the file that you committed on and go to the history for it, then select the earliest commit with the <> icon to view the code at that time.
The git shortlog command is a special version of git log intended for creating release announcements. It groups each commit by author and displays the first line of each commit message. This is an easy way to see who's been working on what.
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>
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With