1 | > git clone url-to-a-repository |
So, recently I was trying to clone a mega-sized repository while working on a company project. However, whenever I wanted to clone it with git clone
it kept popping up the error above. It looks like the root cause is that there is a buffer limit when I need to pull it with HTTPS.
The solution to this is to
- Use
SSH
to clone the repository. - Use
HTTPS
but pull the content of the repository incrementally.
Due to being unable to resolve SSH credential in a short time frame, I chose the second approach
1 | > git clone xxx --depth 1 |
With the commands above, the content can be pulled part by part, instead of in one big chunk.
If it still errors with the same message, instead of git fetch --unshallow
, try using the following command:
1 | > git fetch --depth=100 |