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
Name | Type | Description |
---|---|---|
commitHash | string | The hash of the commit to retrieve the diff for. |
path | string | Optional. 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);