git clone下载内容过大

12 篇文章 0 订阅

git clone下载内容过大


第一种解决方法:
Try reducing the postBuffer size in the remote repository config. Follow the steps below

    Go to remote git repository directory
    Run the following command to reduce the size of postBuffer

        git config http.postBuffer 24288000

    you can check this value by doing "git config --get http.postBuffer"
    Try cloning the repository now (back to where are you cloning)
    If failed with error: RPC failed; result=18, HTTP code = 200 try again by incresing the postBuffer ever further in the config. go to step 1.


We need to adjust/override your client's settings.

git config --global http.postBuffer 524288000
git config --list


第二种解决方法:
不止一次听到抱怨说, Git库好大啊,把整个历史都拉下来,慢死了 我情何以堪呢?!! 你可以单单取最后几个,甚至最后一个版本的啊?

#仅获取最新版和一个历史版本,即最后2个版本

 

git clone http://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git --depth 1

注:我就是用这种方法解决,尤其是gitlinux源码


上面的git clone,仅获取了最后2个版本,我是如何知道的呢?

cd linux-2.6
git rev-list master

#只有2个显示哦:
eeb43e7984e7376f09896a201f82ec9fb5936e21
e905483933c0f16c1c0820c8b1834dbcb5e0c06a

#你也许也已经发现,最新版是最先显示的,rev比较多的时候有点不方便,那么:
git rev-list master --max-count=10
#上面的命令,一眼你就明白了

还是不信?好吧,看具体的log信息:

git log --pretty=format:'%h : %s' --topo-order --graph

#打印:
* eeb43e7 : fix issue #107
* e905483 : add log when load iocObject in ComboIocLoader

#如果你做了一些tag,只希望获取某两个tag直接的log
git log --pretty=format:'%h : %s' --topo-order --graph Tag1..Tag2

默认情况下, git执行N次操作后,才会压缩空间,我一般心情好的时间就敲一下:

#这个命令耗时是比较长的哦
git gc --aggressive

#快速指令
git gc
git中文网站:http://gitbook.liuhui998.com/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值