Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GIT > 20k new files chokes VSCode UI, "Too many active changes"

I am trying to add a folder that has to be tracked, however it is > 1GB / > 20k files.

As soon I add it, I will get warning about too many active changes and Git simply will refuse to work correctly (on VS Code after the warning I cannot commit anything is it says there is no changes (yet left side button shows that there are changes)).

Tried to use command line but simply doesn't push new folder :/

Any advice how to deal with lots of new files ? I will have ~ 5-6x folders between 1GB - 5GB and from 20k - 200k filer per folder.

like image 807
Mike Avatar asked Sep 16 '25 02:09

Mike


1 Answers

I've ran into similar problems with VS Code. If you are currently stuck where VS Code git extension keep repeating this message, put the offending folder in .gitignore then delete the git object cache for it.

git rm -r --cached path/to/folder

A good strategy for large amount of files in VS Code is to compartmentalize each folder and commit separately as stated by Lasse.

Something like in .gitignore structure of splitting the folder like this

folder/folderA
folder/folderB
folder/folderC

Remove one at a time and commit, and be as granular as required. Rinse and repeat. And if you have phpstorm use that instead for these large commits.

like image 168
DanT Avatar answered Sep 17 '25 18:09

DanT