If I run git branch
in a terminal, I get this output:
abstract-controller
core-button-bar
* dev
final-core-datatable
generic-loan-search-exp
working-tags
I have a Bash script that looks like this:
branches=$(git branch)
echo ${branches)
It does output the branches, but also includes all of the files in the current directory.
abstract-controller core-button-bar README.md config <<all the other files>> dev final-core-datatable generic-loan-search-exp working-tags
First, why is it doing this, and second, how can I get just the branches?