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

git-log-branches

From
DADomenico Andreoli <cavokz@gmail.com>
Date
Aug 10, 2007, 07:53 UTC
Message-ID
<20070810075349.GA29584@raptus.dandreoli.com>
Hi,
  in trying to survive in the forest of git repositories I spread all
over my boxes, I came to this script. I use it to see which changes
are in my local branches w.r.t. tracked remotes and vice versa.

It is pretty raw and uses only commands I know. Feel free to point me to better command using. Or to a better script, which I am sure has been already written ;)

cheers, Domenico

#! /bin/sh
if [ -z "$1" ]; then
        echo "usage: $0 <remote>"
        exit
fi
for b in $(git branch | sed 's/^..//'); do
        if ! git branch -r | grep $1/$b >/dev/null; then
                continue
        fi
        if [ -n "$(git log $b..$1/$b)" ]; then
                echo "$b..$1/$b:"
                git log $b..$1/$b
        fi
        if [ -n "$(git log $1/$b..$b)" ]; then
                echo "$1/$b..$b:"
                git log $1/$b..$b
        fi
done
-----[ Domenico Andreoli, aka cavok
 --[ http://www.dandreoli.com/gpgkey.asc
   ---[ 3A0F 2F80 F79C 678A 8936  4FEE 0677 9033 A20E BC50
Message 1 of 1 in “git-log-branches”
  1. Domenico AndreoliAug 10, 2007

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.