Short answer:
git branch --show-current
To put it in a variable in a bash script for example:
current_branch=$(git branch --show-current);
or in Powershell script:
$currentBranch = $(git branch --show-current)
Short answer:
git branch --show-current
To put it in a variable in a bash script for example:
current_branch=$(git branch --show-current);
or in Powershell script:
$currentBranch = $(git branch --show-current)