Jia*_*Jun 147 git git-clone git-tag
--branch
也可以在结果存储库中的提交处获取标记并分离HEAD.
我试过了
git clone --branch <tag_name> <repo_url>
Run Code Online (Sandbox Code Playgroud)
但它不起作用.它返回:
warning: Remote branch 2.13.0 not found in upstream origin, using HEAD instead
Run Code Online (Sandbox Code Playgroud)
如何使用此参数?
Eri*_*ier 244
git clone --branch <tag_name> <repo_url>
Run Code Online (Sandbox Code Playgroud)
git 1.7.9.5不支持此命令.
我使用git 1.8.3.5,它的工作原理
Sah*_*lra 56
使用--single-branch
选项仅克隆导致标记提示的历史记录.这样就可以节省大量不必要的代码.
git clone <repo_url> --branch <tag_name> --single-branch
Run Code Online (Sandbox Code Playgroud)
RzR*_*RzR 30
git clone -b 13.1rc1-Gotham --depth 1 https://github.com/xbmc/xbmc.git
Cloning into 'xbmc'...
remote: Counting objects: 17977, done.
remote: Compressing objects: 100% (13473/13473), done.
Receiving objects: 36% (6554/17977), 19.21 MiB | 469 KiB/s
Run Code Online (Sandbox Code Playgroud)
将比以下更快:
git clone https://github.com/xbmc/xbmc.git
Cloning into 'xbmc'...
remote: Reusing existing pack: 281705, done.
remote: Counting objects: 533, done.
remote: Compressing objects: 100% (177/177), done.
Receiving objects: 14% (40643/282238), 55.46 MiB | 578 KiB/s
Run Code Online (Sandbox Code Playgroud)
要么
git clone -b 13.1rc1-Gotham https://github.com/xbmc/xbmc.git
Cloning into 'xbmc'...
remote: Reusing existing pack: 281705, done.
remote: Counting objects: 533, done.
remote: Compressing objects: 100% (177/177), done.
Receiving objects: 12% (34441/282238), 20.25 MiB | 461 KiB/s
Run Code Online (Sandbox Code Playgroud)
Aki*_*_MJ 18
git clone --depth 1 --branch <tag_name> <repo_url>
Run Code Online (Sandbox Code Playgroud)
例子
git克隆--深度1--分支0.37.2 https://github.com/apache/incubator-superset.git
<tag_name> : 0.37.2
<repo_url> : https://github.com/apache/incubator-superset.git
Run Code Online (Sandbox Code Playgroud)
小智 5
使用命令
git clone --help
Run Code Online (Sandbox Code Playgroud)
查看你的git是否支持该命令
git clone --branch tag_name
Run Code Online (Sandbox Code Playgroud)
如果没有,只需执行以下操作:
git clone repo_url
cd repo
git checkout tag_name
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
163065 次 |
最近记录: |