I forgot to add certain files to my .gitignore when I began my project and consequently committed files I shouldn't have. I ignored the files afterwards as described here. The damage has already happened though since the files still exist in the history of my repository and now my repository is 10gb in size!
I have not pushed the files for the aforementioned reason, so rewriting history should be okay. In short, what I need to do is to rewrite history so that afterwards none of the files in the current .gitignore
exist in any commit in the repository.
Edit: There are lots of small files contributing to the large size, so the suggested duplicate about how to remove all files above a certain size threshold does not solve this problem.