Git Commit Limiting: Difference between revisions
Jump to navigation
Jump to search
(7 intermediate revisions by the same user not shown) | |||
Line 3: | Line 3: | ||
* [[Git_log#Commit_Limiting|git log]] | * [[Git_log#Commit_Limiting|git log]] | ||
* [[Git_rev-list#Commit_Limiting|git rev-list]] | * [[Git_rev-list#Commit_Limiting|git rev-list]] | ||
* [[Working with Dates in Git]] | |||
=Overview= | =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. | 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. Also see: | ||
{{Internal|git rev-list|git rev-list}} | |||
{{Internal|git log|git log}} | |||
=Options= | |||
==-<number>, -n <number>, --max-count=<number>== | ==-<number>, -n <number>, --max-count=<number>== | ||
Line 15: | Line 21: | ||
Show commits more recent than a specific date: | Show commits more recent than a specific date: | ||
<syntaxhighlight lang='bash'> | <syntaxhighlight lang='bash'> | ||
git | git log --since "04/28/2020 9:19 PM PDT" | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Also see: {{Internal|Working with Dates in Git|Working with Dates in Git}} | |||
==--until, --before== | ==--until, --before== | ||
Show commits older than a specific date: | Show commits older than a specific date: | ||
Line 26: | Line 35: | ||
--before="@{7.days.ago}" | --before="@{7.days.ago}" | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Also see: {{Internal|Working with Dates in Git|Working with Dates in Git}} | |||
=Examples= | =Examples= |
Latest revision as of 21:32, 1 October 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. Also see:
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"
Also see:
--until, --before
Show commits older than a specific date:
--before=TODO
--before="@{7.days.ago}"
Also see:
Examples
git rev-list -1 --before="@{7.days.ago}" task/feature1