Creates a new local Git repository from a repository on GitHub. If you have
pre-configured a GitHub personal access token (PAT) as described in
gh::gh_whoami()
, you will get more sensible default behavior for the fork
argument. You cannot create a fork without a PAT. Currently only works for
public repositories. A future version of this function will likely have an
interface closer to use_github()
, i.e. more ability to accept credentials
and more control over the Git configuration of the affected remote or local
repositories.
create_from_github(repo, destdir = NULL, fork = NA, rstudio = NULL,
open = interactive())
GitHub repo specification in this form: owner/reponame
. The
second part will be the name of the new local repo.
The new folder is stored here. Defaults to user's Desktop.
Create and clone a fork? Or clone repo
itself? Defaults to
TRUE
if you can't push to repo
, FALSE
if you can.
Initiate an RStudioProject?
Defaults to TRUE
if in an RStudio session and project has no
pre-existing .Rproj
file. Defaults to FALSE
otherwise.
If TRUE
and in RStudio, new project will be opened in a new
instance, if possible, or will be switched to, otherwise. If TRUE
and not
in RStudio, working directory will be set to the new project.
use_course()
for one-time download of all files in a Git repo,
without any local or remote Git operations.
# NOT RUN {
create_from_github("r-lib/usethis")
# }
Run the code above in your browser using DataLab