我正在从另一个shell脚本运行shell脚本,该脚本是一个git-hook pre-push。 这是.git/hooks/pre-push的内容: #!/usr/bin/env bash
protected_branch='master'
current_branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,')
if [ $protected_branch = $current_branch ]; then
sh test.sh
if [ $? != 0 ]; then