git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] git-branch: add -r switch to list refs/remotes/*

From
EWEric Wong <normalperson@yhbt.net>
Date
Mar 2, 2006, 20:23 UTC
Message-ID
<20060302202317.GA6708@hand.yhbt.net>
In-Reply-To
<20060302055831.GA16600@localdomain>

If we decide to use refs/remotes/, having a convenient way to list them would be nice.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
---
 git-branch.sh |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
05fb74c2a8d4bf3692a7553c5225d25ab54f358a
diff --git a/git-branch.sh b/git-branch.sh
index 6ac961e..663a3a3 100755
--- a/git-branch.sh
+++ b/git-branch.sh
@@ -48,6 +48,12 @@ If you are sure you want to delete it, r
     exit 0
 }
 
+ls_remote_branches () {
+    git-rev-parse --symbolic --all |
+    sed -ne 's|^refs/\(remotes/\)|\1|p' |
+    sort
+}
+
 force=
 while case "$#,$1" in 0,*) break ;; *,-*) ;; *) break ;; esac
 do
@@ -56,6 +62,10 @@ do
 		delete_branch "$@"
 		exit
 		;;
+	-r)
+		ls_remote_branches
+		exit
+		;;
 	-f)
 		force="$1"
 		;;
-- 
1.2.3.gc55f
Previous: Eric WongNext: Nicolas Vilz 'niv'
Message 2 of 3 in “contrib/git-svn: use refs/remotes/git-svn instead of git-svn-HEAD”
  1. contrib/git-svn: use refs/remotes/git-svn instead of git-svn-HEADEric Wong, Mar 2, 2006
  2. git-branch: add -r switch to list refs/remotes/*Eric Wong, Mar 2, 2006
  3. Nicolas Vilz 'niv'Mar 2, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.