From 373c3896729312b6f0d74d9bb37c41d966427f25 Mon Sep 17 00:00:00 2001 From: Harald Pfeiffer Date: Mon, 26 Jan 2026 12:39:07 +0100 Subject: Adding an "other-branches" script to git --- bin/git-other-branches | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 bin/git-other-branches (limited to 'bin') diff --git a/bin/git-other-branches b/bin/git-other-branches new file mode 100644 index 0000000..729ba61 --- /dev/null +++ b/bin/git-other-branches @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +GITBIN='/usr/bin/git' +AWKBIN='/usr/bin/awk' +GREPBIN='/usr/bin/grep' + +# 1. Pull the current branch and also tags, and prune references vanished from remote +# shellcheck disable=SC2016 +"$GITBIN" branch --remotes |\ + "$AWKBIN" '{print $1}' | "$AWKBIN" -F/ '{print $2}' |\ + "$GREPBIN" -v "^$(git rev-parse --abbrev-ref HEAD)\$" -- cgit v1.2.3