secure push

This commit is contained in:
fy59 2026-11-09 19:31:34 +01:00
parent 121bc2a2ef
commit be5b257190

View file

@ -150,18 +150,7 @@ gc() {
read msg read msg
git commit -m "$msg" git commit -m "$msg"
} }
gp() { alias gp='git push'
local branch target
branch="$(git branch --show-current)" || return 1
if [[ -z "$branch" ]]; then
print -u2 "Erreur : aucune branche Git active."
return 1
fi
# URL de fetch : une destination unique, même si origin déclare plusieurs pushurl.
target="$(git remote get-url origin)" || return 1
print -r -- "Push vers une seule destination : $target ($branch)"
git push "$target" "$branch"
}
alias gl='git log --oneline --graph --decorate' alias gl='git log --oneline --graph --decorate'
gpall() { gpall() {
local branch answer local branch answer