• 请不要在回答技术问题时复制粘贴 AI 生成的内容
wangyzj
V2EX  ›  程序员

git clone 有没有办法在保留全部 git log 的情况下大幅度缩减 clone 的仓库大小

  •  
  •   wangyzj · Aug 22, 2022 · 3072 views
    This topic created in 1536 days ago, the information mentioned may be changed or developed.
    7 replies  •  2022-08-24 01:02:45 +08:00
    dreasky
    dreasky
    Aug 22, 2022
    1
    --depth=1
    billzhuang
    billzhuang
    Aug 22, 2022
    2
    是要保留每个 branch 的全部 log 么?
    clrss
    clrss
    Aug 22, 2022
    3
    treeless clone

    还有个 blobless clone ,不过效果不明显。
    Loserzhu
    Loserzhu
    Aug 22, 2022
    4
    git clone --filter=blob:none <your-repo-hrl>
    wangyzj
    wangyzj
    OP
    Aug 22, 2022
    5
    @billzhuang #2 恩
    wangyzj
    wangyzj
    OP
    Aug 22, 2022
    6
    @dreasky #1 depth=1 没有 log
    Arnie97
    Arnie97
    Aug 24, 2022
    7
    关于哪些参数能减少 git clone 内容,减少了哪些部分这个问题,这篇文章图画的比较清楚:
    https://github.blog/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone/
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   4862 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 05:52 · PVG 13:52 · LAX 21:52 · JFK 00:52
    ♥ Do have faith in what you're doing.