updateGit | R Documentation |
Fetches all branches, then pulls the identified branch from git,
then runs a digest on the local folders. If that digest is different
as a previous one, then the function will run
devtools::install(dependencies = FALSE, reload = FALSE, quick = TRUE, ...)
.
This should be safe even in cases where local files have changed. If
they were uncommitted, Git will error, and nothing will be pulled,
and if they were committed, then it will try a merge. If the automoated
merge works, then it will proceed. If automated merge fails, then nothing
will be pulled.
updateGit(
pkgs = NULL,
install = TRUE,
branch = c("development", "master"),
cacheRepo = getOption("pedev.cacheRepo", "~/.pedevCache"),
fetch = TRUE,
submodule = FALSE,
quick = TRUE,
dependencies = FALSE,
reload = FALSE,
...
)
pkgs |
A character vector of package names, which is actually
the path names of the packages. i.e., must be absolute or relative
path. Defaults to current directory. It will also check in "..",
i.e., one folder up from the current active folder if it doesn't find
|
install |
Logical. If TRUE, then it will run |
branch |
A vector of branch names to pull from, in reverse order
so that the first one is the active branch after this function call finishes.
Default is |
cacheRepo |
The location where subsequent calls will store their history. To be most effective, this should be "persistent", and not part of any other cacheRepo. |
fetch |
Logical. Should it fetch before pulling. |
submodule |
Logical. VERY EXPERIMENTAL. |
quick |
if |
dependencies |
Which dependencies do you want to check? Can be a character vector (selecting from "Depends", "Imports", "LinkingTo", "Suggests", or "Enhances"), or a logical vector.
The value "soft" means the same as You can also specify dependencies from one or more additional fields, common ones include:
|
reload |
if |
... |
Passed to |
## Not run:
# This will pull development branch of all these packages, and install them
# all, if there are any file changes in each respective directory
allPkgs <- c("quickPlot", "reproducible", "SpaDES.core", "SpaDES.tools",
"pemisc", "map", "LandR", "pedev")
updateGit(allPkgs)
# Will update and install all development branches of all repositories
# in ~/GitHub folder
pedev::updateGit(dir("~/GitHub"))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.