Files
saasshop/scripts/git_push.sh
2026-03-18 11:15:43 +08:00

17 lines
410 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
set -euo pipefail
# 通用安全推送脚本(当前仓库 origin 已迁移到 Gitea走 SSH key
# 用法bash scripts/git_push.sh
# 行为:仅推送当前分支到 origin并设置 upstream。
REPO_DIR=$(cd "$(dirname "$0")/.." && pwd)
cd "$REPO_DIR"
echo "Pushing to origin ..."
branch=$(git rev-parse --abbrev-ref HEAD)
git push -u origin "$branch"
echo "Push done."