shallow clone

本文介绍了一种使用Git进行浅克隆的方法,通过限制克隆深度来快速获取仓库的最新提交,这种方法非常适合大型仓库,可以显著提高效率。

shallow clone

浅克隆经常在一些大型仓库中很有用——不用花费大量时间去clone一个完整的仓库,仅仅checkout出来某个分支(如master)的最新N次递交:

git clone --depth 1 https://github.com/openwrt/openwrt.git

由于clone的内容非常少,因此速度就大大提升了。查看git log也只有最后一次递交记录而已。

 

转载于:https://www.cnblogs.com/clemente/p/10598664.html

usage: git clone [<options>] [--] <repo> [<dir>] -v, --[no-]verbose be more verbose -q, --[no-]quiet be more quiet --[no-]progress force progress reporting --[no-]reject-shallow don't clone shallow repository -n, --no-checkout don't create a checkout --checkout opposite of --no-checkout --[no-]bare create a bare repository --[no-]mirror create a mirror repository (implies --bare) -l, --[no-]local to clone from a local repository --no-hardlinks don't use local hardlinks, always copy --hardlinks opposite of --no-hardlinks -s, --[no-]shared setup as shared repository --[no-]recurse-submodules[=<pathspec>] initialize submodules in the clone --[no-]recursive ... alias of --recurse-submodules -j, --[no-]jobs <n> number of submodules cloned in parallel --[no-]template <template-directory> directory from which templates will be used --[no-]reference <repo> reference repository --[no-]reference-if-able <repo> reference repository --[no-]dissociate use --reference only while cloning -o, --[no-]origin <name> use <name> instead of 'origin' to track upstream -b, --[no-]branch <branch> checkout <branch> instead of the remote's HEAD --[no-]revision <rev> clone single revision <rev> and check out -u, --[no-]upload-pack <path> path to git-upload-pack on the remote --[no-]depth <depth> create a shallow clone of that depth --[no-]shallow-since <time> create a shallow clone since a specific time --[no-]shallow-exclude <ref> deepen history of shallow clone, excluding ref --[no-]single-branch clone only one branch, HEAD or --branch --[no-]tags clone tags, and make later fetches not to follow them --[no-]shallow-submodules any cloned submodules will be shallow --[no-]separate-git-dir <gitdir> separate git dir from working tree --[no-]ref-format <format> specify the reference format to use -c, --[no-]config <key=value> set config inside the new repository --[no-]server-option <server-specific> option to transmit -4, --ipv4 use IPv4 addresses only -6, --ipv6 use IPv6 addresses only --[no-]filter <args> object filtering --[no-]also-filter-submodules apply partial clone filters to submodules --[no-]remote-submodules any cloned submodules will use their remote-tracking branch --[no-]sparse initialize sparse-checkout file to include only files at root --[no-]bundle-uri <uri> a URI for downloading bundles before fetching from origin remote 是什么意思
最新发布
06-16
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值