git分支操作 - xavierchen/git_command_doc GitHub Wiki
-
git克隆默认到某一个分支(会clone整个版本库)
git clone remote-addr:repo.git -b branch-or-tag-or-commit
-
git克隆单独的一个分支(不带整个版本库)
git clone remote-addr:repo.git -b branch-or-tag-or-commit --single-branch
-
git克隆单独的一个分支(不带整个版本库),并且限定分支的深度
git clone remote-addr:repo.git -b branch-or-tag-or-commit --single-branch --depth
-
git新建分支并切换到新分支
git branch -b (branch-name)