for((i=1;i<5;i++)) do sed -i "s/:$app_name:.*/:$app_name:$app_tag/" $app_file git add $app_file git config user.email [email protected] git config user.name yourname git commit -m "$app_branch $app_name:$app_tag" git push if [ $? -eq 0 ];then echo "推送成功。" exit 0 else if [ $i -gt 3 ];then echo "失败次数过多,请排查原因。" exit 1 fi echo "第$i推送失败,等待重新尝试。" git reset --hard HEAD^ git pull fi sleep 20 done
标签:并发,shell,git,提交 From: https://www.cnblogs.com/hjfeng1988/p/17308702.html