0

I want to clone a repository of mine at https://github.com/puraminy/mt5-comet

It has few folders in each there are few files. But when I want to clone it, it tries to download over 650 objects!!! and the size would be over 90M. So sometimes it crashes in between!

Cloning into 'mt5-comet'...
remote: Enumerating objects: 668, done.
remote: Counting objects: 100% (668/668), done.
remote: Compressing objects: 100% (474/474), done.
Rceiving objects:  46% (313/668), 15.48 MiB | 18.00 KiB/s  

What is the problem, how can I know what big files I have on github and ignore or delete them.

Ahmad
  • 8,811
  • 11
  • 76
  • 141
  • 1
    "over 650 objects" in not a lot in git. It's actually relatively few. Each commit indirectly references trees and blobs, and even if a lot of objects are reused in different trees, the object count for a medium-sized codebase over a few dozens of commits could be well over 650. Which is usually not a problem. – Romain Valeri Oct 20 '21 at 13:06
  • Also, `git count-objects -v` will give you a (maybe useful?) recap. – Romain Valeri Oct 20 '21 at 13:10
  • What you probably didn't realise is that a git clone contains *every revision of the repository*, not just the files which *currently* exist. See [How to remove/delete a large file from commit history in the Git repository?](https://stackoverflow.com/questions/2100907/how-to-remove-delete-a-large-file-from-commit-history-in-the-git-repository) - but note that some of the specific instructions are quite old, and newer solutions may be simpler. – IMSoP Oct 20 '21 at 13:11
  • @IMSoP it seems they are for local files, but what about files on github – Ahmad Oct 20 '21 at 13:35
  • @Ahmad Github is just a server where you can store git repositories, with some tools for viewing and manipulating them. It stores whatever files are in the repository you push to it. If you rewrite the history of your repository to not contain those files, you'll need to "force push" that new repository to Github at the end, that's all. – IMSoP Oct 20 '21 at 13:37
  • @IMSoP but there must be solutions for this case. I pushed them from another computer which isn't accessible now. So github is the only copy, which I want to clone on another PC. Before cloning them, I can run no git command. So, I want to ignore, filter or delete old revisions from github – Ahmad Oct 20 '21 at 13:39
  • @IMSoP finally I cloned it. If there is really no solution, I can ignore this question, cause now I could clone files. – Ahmad Oct 20 '21 at 13:44
  • 1
    @Ahmad Do you need the history, or just a copy of the latest version? There are Download tools in github, and "shallow clones", which will let you get just the files without the history. They won't help you solve the problem in the long run, though, so if you're regularly working with this slow and unreliable internet connection, you'll need to rewrite the history at some point. – IMSoP Oct 20 '21 at 13:44

0 Answers0