【问题标题】:Clone only a particular release from the git repository仅从 git 存储库中克隆特定版本
【发布时间】:2019-05-16 07:24:33
【问题描述】:

我只想从 GIT 存储库 https://github.com/intel/caffe 中克隆版本“Caffe_v1.1.4”。能否请您告诉我用于将内容复制到本地文件夹的脚本。

【问题讨论】:

    标签: git github tags release git-clone


    【解决方案1】:

    Windows 在您的浏览器中打开https://github.com/intel/caffe/archive/1.1.4.tar.gz

    对于 linux 操作系统 curl -s https://github.com/intel/caffe/archive/1.1.4.tar.gz 应该可以工作

    更新

    Windows PowerShell

    $AllProtocols = [System.Net.SecurityProtocolType]'Ssl3,Tls,Tls11,Tls12' //for https support 
    [System.Net.ServicePointManager]::SecurityProtocol = $AllProtocols
    Invoke-WebRequest http://github.com/intel/caffe/archive/1.1.4.zip -OutFile yourpath\caffe.zip
    

    【讨论】:

    • 我想使用 shell 脚本中的命令将发布内容从 repo 克隆到磁盘上的本地文件夹中。我应该如何更改命令?。
    【解决方案2】:

    “克隆”,如果你的意思是“git克隆”存储库,

     git clone -b 1.1.4 --single-branch https://github.com/intel/caffe.git
    

    您还可以添加选项--depth=1 以最小化获取数据的大小。

    如果你的意思是“下载”源代码,

    curl -LOk https://github.com/intel/caffe/archive/1.1.4.zip
    unzip 1.1.4.zip -d foo
    

    【讨论】:

      猜你喜欢
      • 2011-04-03
      • 2018-03-07
      • 2021-12-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-07-14
      相关资源
      最近更新 更多