'Excluding a folder in .gitignore

I am trying to exclude a folder in my project and have added the following lines to the .gitignore:

logs/
tempStorage/
libraries/lib/

The first two are excluded but the last one is still being updated. That folder contains DLLs that are generated by another project in the solution.

I am using Visual Studio 2022. When I rebuild the solution the project target lib updates the DLLs. I don't want to store these in git.

enter image description here

Do I need to do something in git like delete the files?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source