This commit is contained in:
scarqin
2024-12-18 17:30:16 +08:00
parent 86fa87bb7a
commit 1bf43cf137
-7
View File
@@ -4,7 +4,6 @@
BRANCH=$(git rev-parse --abbrev-ref HEAD)
# 如果是从 feature 分支推送
echo $BRANCH
if [[ $BRANCH == feature/* || $BRANCH == fix/* ]]; then
# 获取远程仓库列表
REMOTES=$(git remote)
@@ -14,10 +13,4 @@ if [[ $BRANCH == feature/* || $BRANCH == fix/* ]]; then
echo "Pushing $BRANCH to GitLab..."
git push gitlab $BRANCH
fi
# 只有在明确要求时才推送到 GitHub
if echo "$REMOTES" | grep -q "github"; then
echo "Pushing $BRANCH to GitHub..."
git push github $BRANCH
fi
fi