开发者

Error when cloning git "shallow" repository

开发者 https://www.devze.com 2023-02-06 18:21 出处:网络
I\'m getting the following error when issuing the command git clone --bare /path/to/repo: fatal: attempt to fetch/clone fro开发者_运维问答m a shallow repository

I'm getting the following error when issuing the command git clone --bare /path/to/repo:

fatal: attempt to fetch/clone fro开发者_运维问答m a shallow repository

First, what is a shallow repository and why doesn't it let me clone it?


Rename .git/shallow to something else, clone, rename it back, copy .git/shallow to cloned repository


A shallow repository is a repository which does not contain the full history.

See the git-clone manpage:

--depth

Create a shallow clone with a history truncated to the specified number of revisions. A shallow repository has a number of limitations (you cannot clone or fetch from it, nor push from nor into it), but is adequate if you are only interested in the recent history of a large project with a long history, and would want to send in fixes as patches.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号