| fetch {gert} | R Documentation |
Use git_fetch and git_push to sync a local branch with a remote. Here git_pull is a wrapper for git_fetch which that tries to fast-forward the local branch after fetching.
git_fetch(remote = NULL, refspec = NULL, password = askpass, ssh_key = NULL, verbose = interactive(), repo = ".") git_push(remote = NULL, refspec = NULL, password = askpass, ssh_key = NULL, mirror = FALSE, force = FALSE, verbose = interactive(), repo = ".") git_clone(url, path = NULL, branch = NULL, password = askpass, ssh_key = NULL, bare = FALSE, mirror = FALSE, verbose = interactive()) git_pull(..., repo = ".")
remote |
name of a remote listed in |
refspec |
string with mapping between remote and local refs |
password |
a string or a callback function to get passwords for authentication
or password protected ssh keys. Defaults to askpass which
checks |
ssh_key |
path or object containing your ssh private key. By default we
look for keys in |
verbose |
display some progress info while downloading |
repo |
a path to an existing repository, or a |
mirror |
use the |
force |
use the |
url |
remote url. Typically starts with |
path |
directory of the git repository. For |
branch |
name of branch to check out locally |
bare |
use the |
... |
arguments passed to git_fetch |
Other git: branch, commit,
git_config, repository,
signature
{# Clone a small repository
git_dir <- file.path(tempdir(), 'antiword')
git_clone('https://github.com/ropensci/antiword', git_dir)
# Change into the repo directory
olddir <- getwd()
setwd(git_dir)
# Show some stuff
git_log()
git_branch_list()
git_remote_list()
# Add a file
write.csv(iris, 'iris.csv')
git_add('iris.csv')
# Commit the change
jerry <- git_signature("Jerry", "jerry@hotmail.com")
git_commit('added the iris file', author = jerry)
# Now in the log:
git_log()
# Cleanup
setwd(olddir)
unlink(git_dir, recursive = TRUE)
}