1 2 3 4 5 6 7 8 9 10 11 12 13
if [ "$#" != "1" ] then echo "Usage $0 gitLocalRepositoryDir" exit fi localGitRepository=$1 cd $localGitRepository if [ -e "$localGitRepository" ] then git rev-parse --abbrev-ref HEAD else echo Git Local repository not set fi