In brief
git for-each-ref iterates matching references with selected fields, ordering and formatting. It is clearer for automation than accidentally parsing decorative human output.
Useful to know
git for-each-ref iterates matching references with selected fields, ordering and formatting. It is clearer for automation than accidentally parsing decorative human output. [1]
Choose explicitly whether branches or tags are intended. Passing names into another command or language needs appropriate quoting. Formatted text is not automatically safe executable code.
Sources
For further detail and to check the information: