diffCommits
Show changes between two commits.Function Signature
Parameters
Base commit reference.
Target commit reference.
Optional paths to limit the diff output.
Example
diffFiles
Compare two files directly, even if they are outside a Git repository.Function Signature
Parameters
First file path.
Second file path.
Example
diffHead
Show changes between HEAD and the working tree.Function Signature
Parameters
Optional paths to limit the diff output.
Example
diffRange
Show changes for a commit range.Function Signature
Parameters
Commit range in
A...B format (three-dot notation).Optional paths to limit the diff output.
Example
diffStaged
Show changes staged in the index.Function Signature
Parameters
Optional paths to limit the diff output.
Example
diffWorkingTree
Show changes in the working tree compared to the index.Function Signature
Parameters
Optional paths to limit the diff output.
Example
getChangedFiles
Get a list of files changed in the working tree.Function Signature
Returns
Array of changed file paths.
Example
getStagedFiles
Get a list of files that are currently staged.Function Signature
Returns
Array of staged file paths.
Example
changedFileCount
Get the number of files changed in the working tree.Function Signature
Returns
Number of changed files.
Example
stagedFileCount
Get the number of staged files.Function Signature
Returns
Total count of staged files.
Example
hasDiff
Check whether the working tree contains unstaged changes.Function Signature
Returns
true if unstaged changes exist, otherwise false.Example
hasStagedDiff
Check whether the index contains staged changes.Function Signature
Returns
true if staged changes exist, otherwise false.Example
hasBinaryChanges
Check whether the diff contains binary file changes.Function Signature
Returns
true if binary changes are present, otherwise false.Example
hasOnlyWhitespaceChanges
Check whether all working tree changes are whitespace-only.Function Signature
Returns
true if all changes are whitespace-only, otherwise false.Example
hasOnlyEOLChanges
Check whether all changes are end-of-line only (CRLF ↔ LF).Function Signature
Returns
true if all changes are EOL-only, otherwise false.