我有以下的Git分支用於遍歷所有的Git分支與某些名字
foo
bar
foobar
feature/foo
feature/bar
feature/buzz
你會如何for循環做了以單詞「功能/」開頭的分支?
當我嘗試以下操作時,它奇怪地打印出不僅僅是git分支。
for i in $(git branch --list "feature/*"); do echo $i; done;
stuff.txt
icon.jpg
morestuff.txt
Vagrantfile
feature/foo
feature/bar
feature/buzz
[如何使用bash腳本遍歷所有git分支](http://stackoverflow.com/questions/3846380/how-to-iterate-through-all-git-branches-using-bash-script) – pihentagy 2016-08-24 12:19:13