Git · Inspection
git for-each-ref
Iterates refs with formatting, great for scripting branch reports.
Syntax
git for-each-refExample
Example
git for-each-ref --format='%(refname:short)' refs/heads
More in this group
Learn this in the course
Reference pages are the quick answer. The course explains the why, shows the full example and ends with a challenge.