Description Usage Arguments Details Examples
Rename an existing local branch. It's fine to rename the branch you're on.
1 | git_branch_rename(from, to, repo = ".")
|
from |
Name of the existing branch |
to |
New name for the branch |
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::branch_rename()
.
1 2 3 4 5 6 7 8 9 10 11 12 13 | repo <- git_init(tempfile("githug-branches-"))
owd <- setwd(repo)
## commit so that master branch exists
writeLines("Well, we're not in the middle of nowhere...", "nowhere.txt")
git_commit("nowhere.txt", message = "... but we can see it from here.")
git_branch_list()
## rename master
git_branch_rename("master", "louise")
git_branch_list()
setwd(owd)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.