Git
git_diff()
Show Changes (Diff)
Show changes between commits, working tree, etc.
Usage
git_diff(staged = FALSE, file = NULL)
Arguments
- staged
- Logical; if TRUE, show staged changes (default: FALSE shows unstaged)
- file
- Optional file path to show diff for specific file
Value
Invisibly returns the diff output as a character vector
Examples
if (FALSE) {
git_diff() # Show unstaged changes
git_diff(staged = TRUE) # Show staged changes
git_diff(file = "R/foo.R")
}