Git Commit Limiting: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 19: Line 19:
git log --since "04/28/2020 9:19 PM PDT"
git log --since "04/28/2020 9:19 PM PDT"
</syntaxhighlight>
</syntaxhighlight>
TODO: https://alexpeattie.com/blog/working-with-dates-in-git


==--until, --before==
==--until, --before==

Revision as of 16:23, 1 May 2020

Internal

Overview

Several git commands that list commits have a common set of options that can be used to select a subset of commits to be displayed. Those options are known as "commit limiting" options.

Options

-<number>, -n <number>, --max-count=<number>

Limit the number of commits to output.

--since, --after

Show commits more recent than a specific date:

git log --since "04/28/2020 9:19 PM PDT"

TODO: https://alexpeattie.com/blog/working-with-dates-in-git

--until, --before

Show commits older than a specific date:

--before=TODO
--before="@{7.days.ago}"

Examples

git rev-list -1 --before="@{7.days.ago}" task/feature1