Error when cloning git “shallow” repository

后端 未结 2 1510
悲哀的现实
悲哀的现实 2021-01-04 18:38

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

fatal: attempt to fetch/clone from a shallow repository<

相关标签:
2条回答
  • 2021-01-04 18:48

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

    0 讨论(0)
  • 2021-01-04 19:02

    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 讨论(0)
提交回复
热议问题