Description Usage Arguments Details Value Examples
Stage changes to files in preparation for a commit. In an interactive
session, you'll get the chance to "just stage everything: Y/N?", if you
haven't pre-staged or specified any paths. To pre-authorize the staging of
all current file additions, deletions, and modifications, use
git_stage(all = TRUE)
.
1 2 3 |
... |
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 |
repo |
Path to a Git repo. If unspecified, current working directory is checked to see if it is or is inside a Git repo. |
git_add()
and git_stage()
are aliases for each other, so use
what feels most natural, i.e. "add" a file to the repo and "stage"
modifications. These are convenience wrappers around
git2r::add()
.
nothing
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | 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()
## try this interactively and accept the proposed auto-staging
# git_add()
git_add("max.txt", "louise.txt")
git_status()
write("If done properly armed robbery doesn't have to be a totally unpleasant experience.",
"jd.txt")
write("Is he your husband or your father?", "louise.txt", append = TRUE)
git_status()
git_stage(all = TRUE)
git_status()
git_commit(message = "Brains'll only get you so far and luck always runs out.")
git_status()
setwd(owd)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.