standin000
V2EX  ›  问与答

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

  •  
  •   standin000 · Aug 4, 2014 · 3528 views
    This topic created in 4327 days ago, the information mentioned may be changed or developed.
    git clone会抓取所有版本,太占空间,同步起来也不方便。我只想要最新的版本了,谢谢先了~~
    6 replies    2014-08-05 20:52:19 +08:00
    xxstop
        1
    xxstop  
       Aug 4, 2014   ❤️ 1
    git clone --depth=1
    standin000
        2
    standin000  
    OP
       Aug 4, 2014
    @xxstop 谢谢,但还是带了git目录,也不小。
    jsonline
        3
    jsonline  
       Aug 4, 2014
    github 一个一个点击下载。
    SoloCompany
        4
    SoloCompany  
       Aug 4, 2014   ❤️ 1
    如果是 github 可以把 git 当 svn 用
    直接命令行 svn export https://github.com/foo/bar

    当然也可以 download zip 嘛
    standin000
        5
    standin000  
    OP
       Aug 5, 2014
    @SoloCompany 谢谢,但我用的是私有仓库。
    standin000
        6
    standin000  
    OP
       Aug 5, 2014
    终于找到了, git archive master | tar -x -C /somewhere/else

    http://stackoverflow.com/questions/160608/how-to-do-a-git-export-like-svn-export
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1689 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 74ms · UTC 16:30 · PVG 00:30 · LAX 09:30 · JFK 12:30
    ♥ Do have faith in what you're doing.