Description Usage Arguments Value Examples
Get an overview of the last n
commits. Convenience wrapper around
git2r::commits()
. The print method shows
truncated versions of selected variables, e.g., the commit message, time, and
SHA, but rest assured the full information is present in the returned object.
1 | git_history(repo = ".", ...)
|
repo |
Path to a Git repo. If unspecified, current working directory is checked to see if it is or is inside a Git repo. |
... |
Optional parameters passed through to
|
A data frame with S3 class git_history
, solely for printing
purposes. Variables: the SHA
, commit message
, when
the
commit happened, author
, and email
.
1 2 3 4 5 6 7 8 9 10 11 | repo <- git_init(tempfile("git-history-"))
owd <- setwd(repo)
line1 <- "Thelma: You're a real live outlaw, aren't ya?"
line2 <- paste("J.D.: Well I may be an outlaw, darlin', but you're the one",
"stealing my heart.")
write(line1, "tl.txt")
git_commit("tl.txt", message = "first commit")
write(line2, "tl.txt", append = TRUE)
git_commit("tl.txt", message = "second commit")
git_history()
setwd(owd)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.