V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
git
Pro Git
Atlassian Git Tutorial
Pro Git 简体中文翻译
GitX
ReputationZh
V2EX  ›  git

clone --depth=1 拉取仓库所有文件后,再通过 pull 拉取时,如何只拉取 commit 后变更的文件?

  •  
  •   ReputationZh · 2021-01-21 17:31:23 +08:00 · 1503 次点击
    这是一个创建于 1163 天前的主题,其中的信息可能已经有所发展或是发生改变。
    仓库太大,数百 G,拉一次要半个小时,太慢了。
    有更好的拉取方式吗?不限于 pull 。
    5 条回复    2021-01-25 18:43:06 +08:00
    xupefei
        1
    xupefei  
       2021-01-21 17:39:54 +08:00 via iPhone
    github 的话可以用 api 下载一个 tarball,比 clone 要快点儿。
    还有种办法是每次 pull 的时候也—depth 1
    AoEiuV020
        2
    AoEiuV020  
       2021-01-22 09:31:04 +08:00
    没记错的话,就普通 git pull 就是只拉取后续 commit, 想拉取前面的才要加参数 unshallow,
    ReputationZh
        3
    ReputationZh  
    OP
       2021-01-22 10:32:47 +08:00
    @xupefei 内网的 gitlab,话说几百 G 的文件怎么可能存到 github 上…刚才试了一下,发现 git pull 也可以加参数--depth=1,发现几秒钟就完事了。满足我的需求了。
    julyclyde
        4
    julyclyde  
       2021-01-22 10:44:49 +08:00
    @ReputationZh 几百 G 一般就用 Large file storage 了吧
    ReputationZh
        5
    ReputationZh  
    OP
       2021-01-25 18:43:06 +08:00
    @xupefei 似乎加上--depth=1 后,文件没有更新?
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2922 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 14:06 · PVG 22:06 · LAX 07:06 · JFK 10:06
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.