Skip to content

Instantly share code, notes, and snippets.

@guilyx
Created November 25, 2024 07:02
Show Gist options
  • Select an option

  • Save guilyx/480e13200b90f86bd9f77dbebd81f098 to your computer and use it in GitHub Desktop.

Select an option

Save guilyx/480e13200b90f86bd9f77dbebd81f098 to your computer and use it in GitHub Desktop.
Finds and prints all the repos branches in your directory
for dir in */; do [ -d "$dir/.git" ] && echo -n "Repository: $dir -> " && (cd "$dir" && git rev-parse --abbrev-ref HEAD); done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment