Skip to main content

diff

codebolt.git.diff(commitHash: string, path: string): Promise<any>
Retrieves the diff of changes for a specific commit in the Git repository. Shows the differences between the specified commit and the current state.

Parameters

NameTypeDescription
commitHashstringThe hash of the commit to retrieve the diff for.
pathstringOptional. The file system path of the local Git repository. If not provided, uses the current directory.

Returns:

 Promise<any>
A promise that resolves with the response from the diff event.

Examples

Basic Diff Operation

// Get diff for a specific commit hash
const diffResult = await codebolt.git.diff('abc123def456');
console.log('✅ Git diff result:', diffResult);