Display the history of commits in a specific branch with the option to filter.
The list of commits is returned invisibly and can be extracted using [[i]]
alternatively use git_get()
to return the newest commit after filtering.
git_history(path = ".", branch = NULL, top = 10, ...)git_get(path = ".", branch = NULL, ...)
Only display / search commits which affect this path (dir or file)
Name of branch to display. If a match cannot be found with git_get() in this branch, all branches are searched. Remote branches can be viewed by using the format "origin/master" providing that fetch or pull has downloaded changes.
Maximum number of commits to display (post-filtering)
Filters such as before='2021-01-01' or author='somebody'
Return the git_commit object which best matches a wide variety of types. This is used for git_diff() and git_checkout().
Vector of commit objects invisibly
Single commit object
By default the history of the current branch is returned. The commits of a remote
branch can be found using branch='origin/master
, for example.
The following filter arguments can be given:
n
- integer vector of commits back from latest (1 = most recent commit)
hash
- character to match the beginning of commit hash
before
and after
- date object or string like '2021-01-31'
message
- regular expression string to find in commit message
author
and email
- regular expression string of author or email of the commit
If nothing could be matched, get_git()
will start looking on other branches,
for example when looking for a particular hash. The user is notified if this
happens.