Description Usage Arguments Details Value Examples
Use this to convert a
revision
string into an object of class git_commit
, which is how
the git2r
package handles Git commits.
1 | as.git_commit(x, repo = ".", ...)
|
x |
Target commit, as a
revision
string, e.g. |
repo |
Path to a Git repo. If unspecified, current working directory is checked to see if it is or is inside a Git repo. |
... |
additional arguments (none currently in use) |
githug
uses git2r
, under the hood, to perform local Git
operations. While githug
always identifies a commit via its SHA or a
revision string, git2r
handles repositories as objects of class
git_commit
. If you want to do a Git operation that isn't
exposed via githug
, this function helps you specify the commit
git2r
-style.
An S4 git_commit
object
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | repo <- git_init(tempfile("githug-"))
owd <- setwd(repo)
write("Are these girls real smart or real real lucky?", "max.txt")
write("You get what you settle for.", "louise.txt")
git_commit(all = TRUE,
message = "Brains'll only get you so far and luck always runs out.")
write("If done properly armed robbery doesn't have to be a totally unpleasant experience.",
"jd.txt")
git_commit("jd.txt", message = "J.D. is charming")
## refer to these commits
as.git_commit("HEAD")
as.git_commit("HEAD^")
as.git_commit("master~1")
setwd(owd)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.