chore: add generic git_push script for origin

This commit is contained in:
萝卜
2026-03-18 11:15:43 +08:00
parent 21e555a628
commit a74699202d

16
scripts/git_push.sh Executable file
View File

@@ -0,0 +1,16 @@
#!/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."