Function currentBranch

  • Get the name of the branch currently pointed to by .git/HEAD.

    Returns

    The name of the current branch or undefined if the HEAD is detached.

    Example

    // Get the current branch name
    const branch = await currentBranch({
    fs,
    dir: '/tutorial',
    fullname: false
    })
    console.log(branch)

    Parameters

    Returns Promise<string | undefined>

Generated using TypeDoc