git branch vs $(git branch)

眉间皱痕 提交于 2019-11-28 02:23:46
$ git branch
* master

Try echo * master in your shell and see what you get?

Hint: You'll get the list of files in the current directory from the shell glob expansion of *.

See DontReadLinesWithFor for more details.

Because your first branch (or, the checked out branch) has a * next to it, which is a shell wild card. This is being evaluated and expanded to the list of files in the current directory.

Try checking out a branch further down the list, you'll find the list of files moves to be inserted in the list next to the currently checked out branch, not at the top.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!