Skip to content

Instantly share code, notes, and snippets.

@meoso
Last active April 26, 2017 15:17
Show Gist options
  • Save meoso/54c1cb22f114dd3fd2da4c1f7eb9c602 to your computer and use it in GitHub Desktop.
Save meoso/54c1cb22f114dd3fd2da4c1f7eb9c602 to your computer and use it in GitHub Desktop.
show git status for all local repos found under given path
#!/bin/bash
######################################################################
# purpose : show git status for all local repos found under given path
# author : njd
# created : 2017-Apr-21
# usage : ./all-git-status.sh [path] [| less -r]
######################################################################
ESC="\033"
NORMAL="$ESC[m"
DULL=0
BRIGHT=1
FG_CYAN=36
CYAN="$ESC[${DULL};${FG_CYAN}m"
if [ "$1" == "" ]
then
FS=$(pwd)
else
FS=$1
fi
find "$FS" -type d -name ".git" -exec echo -e "\n${CYAN}{}${NORMAL}" \; -exec git -C "{}/.." status --short --branch \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment