Skip to content

Instantly share code, notes, and snippets.

@agoddard
Created December 3, 2014 05:10
Show Gist options
  • Select an option

  • Save agoddard/cdb95b903a3a91c721c8 to your computer and use it in GitHub Desktop.

Select an option

Save agoddard/cdb95b903a3a91c721c8 to your computer and use it in GitHub Desktop.

Revisions

  1. agoddard created this gist Dec 3, 2014.
    19 changes: 19 additions & 0 deletions ghetto_git_check.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    #!/bin/sh
    for i in $(ls -d */); do
    cd ${i%%/};
    if [ -d .git ]; then
    modified=`git status --porcelain | grep M`
    untracked=`git status --porcelain | grep "?"`
    unpushed=`git status | grep ahead`
    if ! [ -z "$modified" ]; then
    echo "${i%%/} contains uncommitted changes"
    fi
    if ! [ -z "$untracked" ]; then
    echo "${i%%/} contains untracked files"
    fi
    if ! [ -z "$unpushed" ]; then
    echo "${i%%/} has not been pushed"
    fi
    fi
    cd ../
    done