I have a git repo that I need to get working without conflicts. It is .net/c# mvc repo. The problem is dll and pdb files. These files have been accidentally committed to the repo so when I do my initial git pull, I get all these files committed by another developer.
I have setup the .gitignore like so:
bin/
obj/
App_data/
From other posts I believe that is all I should need to do, however, If I build my project and run git status it shows numerous dll and pdb files that are going to be committed.
Is this because those files existed in the repo when I cloned it? If so, what is the best way to go about removing those files?
You need to remove those file first (
git rm), before seeing your.gitignoredirectoves applied to your git repo.You can remove those files only from the index if you want to keep them on the working tree.
(See “
.gitignorefile not ignoring“)But for generated files, it shouldn’t matter if they are removed: you will re-create them at the next compilation, but ignore them because they aren’t part of the index anymore.