.pdb file too large and .gitignore will not resolve the issue

Hi there,

I’m a first year student at Abertay Uni and very new to forums so apologies if this topic is already floating about.

Tech specs:
I’m using VS 2019 and am writing a game for one of my assignments in C++ using the SFML framework.

A few weeks back I tried to push my project to the repo, however I kept getting an error in which it mentioned that the .pdb file is too large. After a bit of research, I discovered that .pdb files over 100mb will result in an error when pushed and this can be resolved by ignoring the .pdb in .gitignore.

However, once I added the .pdb to .gitignore and tried to push, I kept getting the same error as before. I then read that you most likely need to clear the cache in the git repo by using a command but needs the file path of the pdb. Unfortunately, before finding this, the lecturer mentioned that I can delete the .pdb so I don’t have a file path to enter into the command prompt.

Lastly, I found an option to reset commitments with the choice of either resetting hard or mixed. At this point I had been coding for 3 further days without being able to push to my repo. So when I hit the hard reset, I was in complete and utter shock to find half my code missing and the error still existet.

What I am trying to do, is to get the .pdb on .gitignore and remove it from my previous commitment so that I don’t receive this error.

The error I’m receiving is as follows:

Remote: Error: File Coursework/x64/Debug/CMP105App.pdb is 103.79 MB; this exceeds GitHub's file size limit of 100.00 MB ```

As I mentioned before, there is no `.pdb` file to be found. I'm also not looking to using git-lfs as that wouldn't be a valid solution for me.

If there is someone who can help with this issue I'd be very grateful. 

Thanks,

Jan

Welcome to the GitHub community, @JanHuss and congrats on learning to code! We’re happy you’re here. You are more likely to get a useful response if you are posting your question(s) in the applicable category.I’ve gone ahead and moved it for you. Good luck!

This is incorrect: .gitignore does not affect files that have already been added. It only prevents you from accidentally adding matching new files, and from seeing them listed as “untracked files” all the time.

So, what you need to do is edit your commit history to remove the file. Git - Rewriting History describes how to do that in general. There are also some tools for your specific case (removing a file from all commits), see Removing sensitive data from a repository - GitHub Docs.

Good luck! :slight_smile:

@liligalante thank you for the welcome message and thank you for categorizing my post. :slightly_smiling_face:

@airtower-luna thank you for the clarification. Your help has been incredibly educational. I first was struggling to understand how to apply the commands but I managed to get around this by using git extensions. The first link you sent me on rewriting my commit history was exactly what needed to be done so I can’t thank you enough.

Do I need to change the subject to [solved] or something? I saw this on other forums so want to make sure I adhere to the rules.

Once again thank you! Have a great week.

All the best,

Jan

1 Like

You’ve already picked marked a post as the solution, so the thread is automatically marked as solved. Thank you! :slightly_smiling_face: