0

I am facing a re-occurring problem specifically with Solana Anchor ReactJS projects where I can't commit my projects into Github because my git keeps pulling in my test-ledger rocksdb files.

Why is RockDB file getting this large? Where else would this file be saved? Or if this is just a Git issue, how do I refresh my git, I already tried git init.

Below is my error:

remote: Resolving deltas: 100% (47/47), completed with 3 local objects.
remote: warning: File test-ledger/rocksdb/007966.log is 74.53 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB
remote: error: Trace: 46ad6aee3f87092f2afac914588b0060daf72596be639119562602af35c71a87
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File test-ledger/validator-1641249558759.log is 1176.23 MB; this exceeds GitHub's file size limit of 100.00 MB

As you can see I don't have a test-ledger folder in my project directory and the other folder my test-ledger is saved in .anchor is in my .gitignore file.

enter image description here

When I look into my project folder, I don't see the test-ledger, see the image below: enter image description here

Mabel Oza
  • 557
  • 8
  • 22
  • This is not a Git issue, except to the extent that if you want Git *not* to save some file, you may need to instruct Git "don't save this file in commits". Note that if you've *already saved the file in existing commits*, those commits *cannot be fixed*. No existing commit can ever be changed. Those commits are that way forever. If those commits are a problem, you can choose to eject the commits from your repository entirely, though this is generally a pretty drastic solution (since it also ejects all subsequent commits). – torek Jan 10 '22 at 04:45
  • 1
    There are some tools for doing exactly this—taking some existing repository, that has unwanted large files in it for instance, and ejecting those files by redoing those commits *and every subsequent commit* so that if you have, say, 100 "bad" commits, you make 100 "new and improved replacement" commits, eject all 100 bad commits, and use the 100 replacements instead. Since we generally find commits by name rather than hash ID, we (humans) don't notice this rewrite. Git, however, finds commits by hash ID, rather than name, so Git *does* notice. – torek Jan 10 '22 at 04:47
  • 1
    In any case, if these files should never have been committed, you can use these tools to rewrite the old commits, *and* add instructions to Git (via the misnamed `.gitignore` files) not to save those files in future commits either. – torek Jan 10 '22 at 04:48
  • @torek thank you! I appreciate the explanation, there are these commits in history. Is there a git command to view the commits related to saving this large file? – Mabel Oza Jan 10 '22 at 07:15
  • 1
    There's nothing particularly suited built into Git. See [here](https://stackoverflow.com/q/2100907/1256452) for methods for doing the repository cleanup, and [here](https://stackoverflow.com/q/10622179/1256452) for how to find the large files. – torek Jan 10 '22 at 07:20

0 Answers0