wflow_git_commit {workflowr}R Documentation

Commit files

Description

wflow_git_commit adds and commits files with Git. This is a convenience function to run Git commands from the R console instead of the shell. For most use cases, you should use wflow_publish instead, which calls wflow_git_commit and then subsequently also builds and commits the website files.

Usage

wflow_git_commit(
  files = NULL,
  message = NULL,
  all = FALSE,
  force = FALSE,
  dry_run = FALSE,
  project = "."
)

Arguments

files

character (default: NULL). Files to be added and committed with Git. Supports file globbing.

message

character (default: NULL). A commit message.

all

logical (default: FALSE). Automatically stage files that have been modified and deleted. Equivalent to: git commit -a

force

logical (default: FALSE). Allow adding otherwise ignored files. Equivalent to: git add -f

dry_run

logical (default: FALSE). Preview the proposed action but do not actually add or commit any files.

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

Some potential use cases for wflow_git_commit:

Under the hood, wflow_git_commit is a wrapper for add and commit from the package git2r.

Value

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

See Also

wflow_publish

Examples

## Not run: 

# Commit a single file
wflow_git_commit("analysis/file.Rmd", "Add new analysis")
# Commit multiple files
wflow_git_commit(c("code/process-data.sh", "output/small-data.txt"),
             "Process data set")
# Add and commit all tracked files, similar to `git commit -a`
wflow_git_commit(message = "Lots of changes", all = TRUE)

## End(Not run)


[Package workflowr version 1.7.1 Index]