When I use the command substitution operator in git-bash.exe
, the output does not seem to be correct. For example:
$ git branch
master
one
* two
$ ls
a b c
$ echo $(git branch)
master one a b c two
As you can see, the output of $(git branch)
seems to have the files in the current working directory inserted into it.
Why is this happening, and how can I fix it?