Description Usage Arguments Details Value Examples
Write file changes to the repository. If there are staged changes, the simple
call git_commit(message = "my message")
makes a commit. If nothing's
staged and it's an interactive session, you'll get an offer to "just stage &
commit everything: Y/N?". To explicitly authorize "stage and commit" for all
current file additions, deletions, and modifications, use
git_commit(all = TRUE)
, which emulates git add -A && git
commit
. In an interactive session, you will also get the chance to enter a
missing commit message.
1 2 |
... |
One or more paths or shell glob patterns that will be matched against files in the repo's working directory. Paths that match will be added to the set of changes staged for the next commit. |
all |
Logical, consulted if no paths are given. If |
force |
Logical, defaults to |
message |
The commit message. Required. If not supplied, user will get a chance to provide the message in an interactive session. |
repo |
Path to a Git repo. If unspecified, current working directory is checked to see if it is or is inside a Git repo. |
Convenience wrapper around git2r::commit()
and,
possibly, git_stage()
.
SHA of the commit. The when
attribute holds the commit time as
POSIXct
. An excerpt of the commit message is in the msg_start
attribute.
1 2 3 4 5 6 7 8 9 10 11 12 | 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_status()
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_status()
git_commit("jd.txt", message = "J.D. is charming")
setwd(owd)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.