mcopy/scripts/branch_name.sh

8 lines
145 B
Bash

#!/bin/bash
branch_name=$(git symbolic-ref -q HEAD)
branch_name=${branch_name##refs/heads/}
branch_name=${branch_name:-HEAD}
echo $branch_name