From 5c0cba776bc8f128233b696c8360e0482763b3b0 Mon Sep 17 00:00:00 2001 From: Akemi Izuko Date: Wed, 8 May 2024 20:13:25 -0600 Subject: [PATCH] Scripts: add git push all --- bin/gitpushall.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 bin/gitpushall.sh diff --git a/bin/gitpushall.sh b/bin/gitpushall.sh new file mode 100755 index 0000000..8e8f1cc --- /dev/null +++ b/bin/gitpushall.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +# Pushes this branch to all remotes +if ! git branch >/dev/null; then + exit 1 +fi + +declare -r branch="$(git branch | grep '*' | cut -c 3-)" + +git remote -v | + grep '\(push\)' | + awk -F' ' -vbranch="$branch" '{ system("(git push " $1 " " branch ") &") }'