Say I have a git repo containing these items at the project root, which is also my working directory.
dir1 dir2 script.sh
And I have git branches titled
master 077-fix_issue_a 078-fix_issue_b
I find that if I run the git branch command, I get the following output
077-fix_issue_a
078-fix_issue_b
master
But if I run
for i in `git branch`
do
echo $i
done
I get the output of
077-fix_issue_a
078-fix_issue_b
dir1
dir2
script.sh
master
Why does git branch also contain a list of directory items when run with command substitution?