`git clone --depth=1` 之后怎样获取完整仓库?
巴扎黑
巴扎黑 2017-04-24 09:13:04
[Git讨论组]

只拿到了一个分支一个 commit, 再运行 fetch 也拿不到其他的分支和 commits 了.
尝试了 git fetch --all git fetch origin 无效.
用什么命令来获取完整的仓库呢?


更新:

搜到一段文章说不能继续... 不知道是不是真的:
http://strk.keybit.net/blog/2011/06/07/getting-just-the-tip-of-a-remote-git-branch/

A shallow repository (one with short history) cannot be further cloned,

巴扎黑
巴扎黑

全部回复(3)
ringa_lee

参考 @Leedy 和 @依云 的答案, 找到有个 unshallow 参数:

git fetch --help


--unshallow
           Convert a shallow repository to a complete one, removing all the limitations imposed by shallow repositories.
PHPz
$ git fetch --help

--depth=<depth>

Deepen or shorten the history of a shallow repository created by git clone with --depth= option (see git-clone(1)) to the specified number of commits from the tip of each remote branch history. Tags for the deepened commits are not fetched.

天蓬老师

git pull --unshallow

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送

Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号