shell获取分支名的两个方式

2020-11-26  本文已影响0人  ChoiKarl

shell获取分支名的两个方式

now_branch_name=git symbolic-ref --short -q HEAD
echo "$now_branch_name"

now_branch_name=git rev-parse --abbrev-ref HEAD
echo "$now_branch_name"

上一篇 下一篇

猜你喜欢

热点阅读