Last active
November 2, 2021 08:59
-
-
Save dtrugman/ec4d40e7b05f01251e4c688ae62219fd to your computer and use it in GitHub Desktop.
Describe git projects
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
git-describe() { | |
for dir in *; do | |
[[ -d "$dir" ]] || continue | |
[[ -d "$dir/.git" ]] || continue | |
local branch="$(cd "$dir"; git rev-parse --abbrev-ref HEAD)" | |
echo "$dir -> $branch" | |
done | |
} | |
[[ "$0" == "$BASH_SOURCE" ]] && git-describe "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As always, you are right 😉