chore: harden dual-remote git workflow

This commit is contained in:
Md Bayazid Bostame
2026-03-31 12:32:36 +02:00
parent 8f61e43e9b
commit 5867d85e96
4 changed files with 63 additions and 1 deletions

View File

@@ -18,7 +18,8 @@ Usage:
Commands:
status
Show current branch, current commit, active local git identity, and configured remotes.
Show current branch, current commit, active local git identity, configured remotes,
and the local push-safety settings.
push-origin [ref]
Push a ref to the main product remote "origin".
@@ -59,11 +60,20 @@ show_identity() {
fi
}
show_push_safety() {
local push_default hooks_path
push_default="$(git config --local --get remote.pushDefault || true)"
hooks_path="$(git config --local --get core.hooksPath || true)"
echo "remote.pushDefault: ${push_default:-<unset>}"
echo "core.hooksPath: ${hooks_path:-<unset>}"
}
case "${1:-}" in
status)
echo "Branch: $(current_branch)"
echo "Commit: $(git rev-parse --short HEAD)"
show_identity
show_push_safety
echo
echo "Remotes:"
git remote -v