method GitOperations.prototype.getCurrentCommitHash
GitOperations.prototype.getCurrentCommitHash(): Promise<string>

Get current commit hash (short format).

Examples

Example 1

const hash = await git.getCurrentCommitHash();
console.log(`Current commit: ${hash}`);

Return Type

Promise<string>

First 7 characters of current HEAD commit hash

Usage

import { GitOperations } from ".";