git {gitr}R Documentation

Git Utilities

Description

Provides functionality for system-level git commands from within R.

Usage

git(..., echo_cmd = TRUE)

is_git()

git_version()

git_checkout(branch = NULL)

Arguments

...

Additional arguments passed to the system command-line ⁠git <command> [<args>]⁠ call.

echo_cmd

Logical. Whether to print the command to run to the console.

branch

Character. The name of a branch, typically a feature branch.

Value

git(): The system call ... invisibly.

is_git(): Logical.

git_version(): Character. The system version of git.

git_checkout(): NULL ... invisibly.

Functions

Examples

## Not run: 
git("status", "-s")

get_commit_msgs()

get_commit_msgs(n = 3)

get_pr_msgs()

# lint most recent 3 commit message
lapply(get_commit_msgs(n = 3), lint_commit_msg)

# for a PR `branch` -> `remotes/origin/{main,master}`
lapply(get_pr_msgs(), lint_commit_msg)           # current branch
lapply(get_pr_msgs("feature"), lint_commit_msg)  # `feature` branch

get_recent_tag()

## End(Not run)

[Package gitr version 0.0.1 Index]