I would like to print only the branch name prefixes of a git repo. For example, if a repo had the following branches,
bug/nasty-problem
feature/neat-thing
feature/awesome-thing
main
is there a way to print only bug
, feature
, and main
?
This will work in your case if you're using terminal etc.
git branch --list | awk -F'/' '{print $1}' | sort -u