
Git-wtf : Displays the state of your repository in an easily readable format - r11t
http://git-wt-commit.rubyforge.org/git-wtf
======
timf
The link is to the source code. If you'd rather understand what this does by
seeing example output (without running it), see:

<http://git-wt-commit.rubyforge.org/#git-wtf>

~~~
nixme
Sweet! He's got a script to automate pushing a local branch to a remote and
setting up tracking at one shot: <http://git-wt-commit.rubyforge.org/git-
publish-branch>

I always forget the exact config settings each time I have to do it...
probably should have written a script myself after doing it twice :)

~~~
boundlessdreamz
If you don't mind using ruby, you can use git remote branch

<http://grb.rubyforge.org/>

It has got many timesaving tricks.

------
tlrobinson
Works great with this little script I wrote to execute commands on all my
repos:

    
    
        #!/bin/sh
    
        REPOS="\
        $HOME/git/repo1 \
        $HOME/git/repo2 \
        $HOME/git/repo3"
    
        for REPO in $REPOS; do
            echo "=============="
            echo $REPO
            if [ -d "$REPO" ]; then
                pushd "$REPO" > /dev/null
                    sh -c "$1"
                popd > /dev/null
            else
                echo "$REPO doesn't exist"
            fi
        done
        echo "=============="
    

Save it as "eachrepo" or something, then do

    
    
        eachrepo "git wtf"

~~~
thristian
Some friendly shell-scripting hints!

— Quoted strings continue until the close quote, regardless of intervening
newlines, tabs or spaces. Your REPOS definition would be more readable without
the backslashes and work just as well:

    
    
      REPOS="
        $HOME/git/repo1
        $HOME/git/repo2
        $HOME/git/repo3
        "
    

— pushd and popd are handy, but are bash extensions and not part of POSIX
/bin/sh (and yes, a lot of systems including Ubuntu and Debian have a bare
POSIX /bin/sh). Even when they are available, shell error handling can make it
difficult to be sure that each pushd has a matching popd. A simpler approach
is to just cd in the subshell:

    
    
      sh -c "cd $REPO; $1"
    

— Rather than explicitly invoking the shell you might find it easier to do the
same thing with syntax:

    
    
      (
        cd $REPO
        eval "$1"
      )
    

...or, you might find that even less readable. Up to you!

~~~
jrockway
No need. "git --git-dir $REPO/.git --work-tree $REPO <command>" is (almost)
exactly equivalent to cd-ing to the work tree.

------
tptacek
God bless you and your children and your childrens childrens children, for 7
weeks.

