Git

git_diff

Show Changes (Diff)

Show changes between commits, working tree, etc.


Usage

git_diff(staged = FALSE, file = NULL)

Arguments

Argument Description
staged

Logical; if TRUE, show staged changes (default: FALSE shows unstaged)

file

Optional file path to show diff for specific file

Returns

Invisibly returns the diff output as a character vector

Examples

git_diff()             # Show unstaged changes
git_diff(staged = TRUE) # Show staged changes
git_diff(file = "R/foo.R")

Source: R/git_hooks.R