V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
standin000
V2EX  ›  问与答

请教 git 不通过克隆方式如何抓起仓库的最新版本文件

  •  
  •   standin000 · 2014-08-04 20:39:43 +08:00 · 3054 次点击
    这是一个创建于 3559 天前的主题,其中的信息可能已经有所发展或是发生改变。
    git clone会抓取所有版本,太占空间,同步起来也不方便。我只想要最新的版本了,谢谢先了~~
    6 条回复    2014-08-05 20:52:19 +08:00
    xxstop
        1
    xxstop  
       2014-08-04 20:41:27 +08:00   ❤️ 1
    git clone --depth=1
    standin000
        2
    standin000  
    OP
       2014-08-04 20:54:59 +08:00
    @xxstop 谢谢,但还是带了git目录,也不小。
    jsonline
        3
    jsonline  
       2014-08-04 20:56:20 +08:00
    github 一个一个点击下载。
    SoloCompany
        4
    SoloCompany  
       2014-08-04 23:23:29 +08:00   ❤️ 1
    如果是 github 可以把 git 当 svn 用
    直接命令行 svn export https://github.com/foo/bar

    当然也可以 download zip 嘛
    standin000
        5
    standin000  
    OP
       2014-08-05 18:26:24 +08:00
    @SoloCompany 谢谢,但我用的是私有仓库。
    standin000
        6
    standin000  
    OP
       2014-08-05 20:52:19 +08:00
    终于找到了, git archive master | tar -x -C /somewhere/else

    http://stackoverflow.com/questions/160608/how-to-do-a-git-export-like-svn-export
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   772 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 20:33 · PVG 04:33 · LAX 13:33 · JFK 16:33
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.