获取git的当前分支名称

git branch | grep "*" | awk -F "_" '{print $2}'

原文地址:https://www.cnblogs.com/fang9159/p/3772726.html