17 lines
410 B
Bash
Executable File
17 lines
410 B
Bash
Executable File
#!/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."
|