Can't prune git as my ram is not enough

One of the projects that I am editing on (not owned by me), disk space has reached over 93% and I found out that it’s mainly because of the .git file. I tried pruning it by running the command git prune; git gc but the memory is not enough to compile the action and will just terminate the process by itself.

Edit : The project name is global-data.