git clone 某單一個分支 branch

git clone 某單一個分支 branch,有時候只想從遠端 clone 某個 branch 下來就可以使用這個指令。

1
git clone <url> --branch <branch> --single-branch [<folder>]

範例

1
git clone <url> --branch master --single-branch

參考
How do I clone a single branch in Git? - Stack Overflow
https://stackoverflow.com/questions/1778088/how-do-i-clone-a-single-branch-in-git