Skip to content

Instantly share code, notes, and snippets.

@olive42
Created May 11, 2022 08:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save olive42/27cf0408a8330b992d73bb1d5f5280c1 to your computer and use it in GitHub Desktop.
Save olive42/27cf0408a8330b992d73bb1d5f5280c1 to your computer and use it in GitHub Desktop.
# Iterate through Git directories and display their branch
# Use-case: check if we are all on master or not
function showcurrentbranch () {
find ${1:-.} -type d -path '*/.git' -printf '%h\n' -prune | xargs -I{} zsh -c \
"echo {} ; pushd {} && git branch --show-current ; popd"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment