Git rev-list: Difference between revisions
Jump to navigation
Jump to search
Line 29: | Line 29: | ||
Show commits order than a specific date: | Show commits order than a specific date: | ||
<syntaxhighlight lang='bash'> | <syntaxhighlight lang='bash'> | ||
--before=TODO | |||
</syntaxhighlight> | |||
<syntaxhighlight lang='bash'> | |||
--before="@{7.days.ago}" | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Revision as of 20:37, 29 April 2020
Internal
Overview
Lists commit objects in reverse chronological order, starting with a given commit(s). The command follows the parent links and displays the commits that are reachable - and exclude commits that are reachable from the commits that are specified with a ^ in front of them. The output is given in reverse chronological order by default. Various options and path parameters can be used to further limit the output.
For example:
git rev-list commit1 commit2 ^commit3
means "list all commits reachable from commit1 and commit2 but not from commit3.
The commits can be specified using their hash, a branch name, etc.
Output 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 order than a specific date:
--before=TODO
--before="@{7.days.ago}"
Examples
git rev-list -1 --before="@{7.days.ago}" task/feature1