commit 1052445933da93d0b1fe85e4af6c7606428f46f3
parent 19e639395cbd9e4914190b3d3f4a1678d1a9d221
Author: gearsix <gearsix@tuta.io>
Date:   Sat, 14 Jun 2025 11:23:38 +0100
added src/posix/git-push-all
Diffstat:
2 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/README.md b/README.md
@@ -85,6 +85,7 @@ Scripts related to string parsing/manipulation
   - You can also use it for setting global config using `-g`
 - *git-clone-bulk* - clone a list of git repositories.
 - *git-pull-all* - pull all remote git branches from the current upstream.
+- *git-push-all* - push all local branches to the default remote (origin)
 - *git-pradd* - git diff $@, for each prompt y/n whether to git add it
 - *git-init* - initialize a git server repository (I use it for my own remote server)
 - *gobuild* - build a go module in all available output formats, useful for releases.
diff --git a/src/posix/git-push-all.sh b/src/posix/git-push-all.sh
@@ -0,0 +1,14 @@
+#!/usr/bin/env sh
+# description: push all branches to 'origin' remote
+
+if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
+	echo "Usage: git-pull-all"
+	echo ""
+	echo "push all branches to 'origin' remote"
+	exit
+fi
+
+for branch in $(git branch | sed 's/\*\? \+//')
+do git push -u origin "$branch"
+done
+