wflow_git_pull {workflowr}R Documentation

Pull files from remote repository

Description

wflow_git_pull pulls the remote files from your remote repository online (e.g. GitHub or GitLab) into your repository on your local machine. This is a convenience function to run Git commands from the R console instead of the Terminal. The same functionality can be achieved by running git pull in the Terminal.

Usage

wflow_git_pull(
  remote = NULL,
  branch = NULL,
  username = NULL,
  password = NULL,
  fail = TRUE,
  dry_run = FALSE,
  project = "."
)

Arguments

remote

character (default: NULL). The name of the remote repository. See Details for the default behavior.

branch

character (default: NULL). The name of the branch in the remote repository to pull from. If NULL, the name of the current local branch is used.

username

character (default: NULL). Username for online Git hosting service (e.g. GitHub or GitLab). The user is prompted if necessary.

password

character (default: NULL). Password for online Git hosting service (e.g. GitHub or GitLab). The user is prompted if necessary.

fail

logical (default: TRUE) Abort the pull if any merge conflicts are detected. If you are sure you want to manually cleanup the merge conflicts, set fail = FALSE. The argument fail is passed to the git2r function merge.git_repository.

dry_run

logical (default: FALSE). Preview the proposed action but do not actually pull from the remote repository.

project

character (default: ".") By default the function assumes the current working directory is within the project. If this is not true, you'll need to provide the path to the project directory.

Details

wflow_git_pull tries to choose sensible defaults if the user does not explicitly specify the remote repository and/or the remote branch:

Under the hood, wflow_git_pull is a wrapper for pull from the package git2r.

Value

An object of class wflow_git_pull, which is a list with the following elements:

Examples

## Not run: 

# Pull from remote repository
wflow_git_pull()
# Preview by running in dry run mode
wflow_git_pull(dry_run = TRUE)

## End(Not run)


[Package workflowr version 1.7.1 Index]