chore: harden dual-remote git workflow
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user