コマンドの返り値を変数に代入する方法
branch=$(git symbolic-ref --short HEAD)
if [ ${branch} = 'master' ]; then
echo 'master'
elif [ ${branch} = 'develop' ]; then
echo 'develop'
else
echo 'other branch'
fi
ヒント: http://sweng.web.fc2.com/ja/program/bash/bash-store-command-result.html