Description Usage Arguments Details Value Examples
Create a new Git repository or re-initialize an existing one, similar to
git init.
1 | git_init(path = ".")
|
path |
Where to create the new Git repo. Defaults to current working
directory. If the |
Will bad things happen if you git_init() in a directory that is
already a Git repo? No, it's fine! To quote the
git-init man page, "running
git init in an existing repository is safe. It will not overwrite
things that are already there". A legitimate reason to do this is to pick up
a new Git template, a topic which newcomers can safely ignore.
git_init() will not create a Git repo in a subdirectory of an existing
Git repo. The proper way to do this is via
Git submodules,
which is beyond the current scope of the package.
Path to the associated Git repo.
1 2 3 4 5 6 7 8 9 10 11 12 13 | repo <- git_init(tempfile("git-init-example-"))
## switch working directory to the repo
owd <- setwd(repo)
## Config local user and make a commit
git_config(user.name = "thelma", user.email = "thelma@example.org")
write("I don't ever remember feeling this awake.", "thelma.txt")
git_commit("thelma.txt", message = "thelma is awake")
git_history()
setwd(owd)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.