Git Commit Limiting: Difference between revisions
Jump to navigation
Jump to search
Line 7: | Line 7: | ||
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. | ||
==-<number>, -n <number>, --max-count=<number>== | |||
Limit the number of commits to output. | |||
==--since, --after== | |||
Show commits more recent than a specific date: | |||
<syntaxhighlight lang='bash'> | |||
git rev-list --since=TODO | |||
</syntaxhighlight> | |||
==--until, --before== | |||
Show commits older than a specific date: | |||
<syntaxhighlight lang='bash'> | |||
--before=TODO | |||
</syntaxhighlight> | |||
<syntaxhighlight lang='bash'> | |||
--before="@{7.days.ago}" | |||
</syntaxhighlight> | |||
=Examples= | |||
<syntaxhighlight lang='bash'> | |||
git rev-list -1 --before="@{7.days.ago}" task/feature1 | |||
</syntaxhighlight > |
Revision as of 16:12, 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.
-<number>, -n <number>, --max-count=<number>
Limit the number of commits to output.
--since, --after
Show commits more recent than a specific date:
git rev-list --since=TODO
--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