Files
PowerShell-PowerShell/scripts/get-current-ref.sh
T

6 lines
153 B
Bash
Executable File

#!/bin/bash
branch=$(git for-each-ref --format=$'%(objectname) %(refname:short)' refs/heads | awk "/^$(git rev-parse HEAD)/ {print \$2}")
echo $branch