wflow_commit: Commit files

Description Usage Arguments Details Value See Also Examples

Description

wflow_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_commit and then subsequently also builds and commits the website files.

Usage

1
2
wflow_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_commit:

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

Value

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

See Also

wflow_publish

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 

# Commit a single file
wflow_commit("analysis/file.Rmd", "Add new analysis")
# Commit multiple files
wflow_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_commit(message = "Lots of changes", all = TRUE)

## End(Not run)

jdblischak/workflowrBeta documentation built on May 17, 2019, 7:28 p.m.