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 ") &") }'