chore: add generic git_push script for origin
This commit is contained in:
16
scripts/git_push.sh
Executable file
16
scripts/git_push.sh
Executable 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."
|
||||||
Reference in New Issue
Block a user