repo <- git_init(tempfile("githug-to-git2r-example-"))
owd <- setwd(repo)
git_config(user.name = "jd", user.email = "jd@example.org")
writeLines(paste("Well, I've always believed that if done properly, armed",
"robbery doesn't have to be an unpleasant experience."),
"jd.txt")
git_add("jd.txt")
git_commit("jd is a smooth talker")
## here's a rather exotic Git operation that githug is unlikely to expose:
## odb_blobs() lists "all blobs reachable from the commits in the object database"
## pre-process the repo with as_git_repository() to prepare for git2r
git2r::odb_blobs(as_git_repository())
setwd(owd)
Run the code above in your browser using DataLab