Skip to content

Instantly share code, notes, and snippets.

@chmouel
Created February 14, 2013 15:35
Show Gist options
  • Save chmouel/4953578 to your computer and use it in GitHub Desktop.
Save chmouel/4953578 to your computer and use it in GitHub Desktop.
Take bunch of git repos and show which one is not on master
#!/bin/zsh
for i in $PWD/*/.git(:h);do
pushd >/dev/null $i;
branch=${${"$(<.git/HEAD)"#ref: }#refs/heads/};
[[ ${branch} != master ]] && echo ${i}(:t) : ${branch}
popd >/dev/null
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment