Get the name of the branch currently pointed to by .git/HEAD.
The name of the current branch or undefined if the HEAD is detached.
// Get the current branch nameconst branch = await currentBranch({ fs, dir: '/tutorial', fullname: false})console.log(branch)
Generated using TypeDoc
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