git clone
Posted 654321cc
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了git clone相关的知识,希望对你有一定的参考价值。
官方文档:https://git-scm.com/docs/git-clone
1 --depth<depth>
Create a shallow clone with a history truncated to the specified number of commits. Implies --single-branch
unless --no-single-branch
is given to fetch the histories near the tips of all branches. If you want to clone submodules shallowly, also pass --shallow-submodules
.
只克隆最近的一次commit
2 -b <name>
Instead of pointing the newly created HEAD to the branch pointed to by the cloned repository’s HEAD, point to <name>
branch instead. In a non-bare repository, this is the branch that will be checked out.--branch
can also take tags and detaches the HEAD at that commit in the resulting repository.
clone时某个<name>分支而不是默认Origin HEAD(master)
示例:https://www.cnblogs.com/nylcy/p/6569284.html
以上是关于git clone的主要内容,如果未能解决你的问题,请参考以下文章