Newbie confused about gitignore

I’m trying to create a line in my gitignore file to ignore all *.o files in sub folders of my “Firmware” folder.  Presently there are many *.o files existing here:

“C:\Tasks\Dropbox\BugLight\D Firmware\Firmware\Nightlight\BUGBRD-04_GIT_TEST_2\buglight\build\default\production”

This works:


But this doesn’t:


What should the line be?

Apologies for not responding to this sooner.

Where is the root of your git repository in this scenario? Because if the root of the repository is at BUGBRD-04_GIT_TEST_2 then the behavior you describe would make complete sense.

You can also use the command:

git status --ignored

To see what paths will be ignored with your current configuration.

I hope that helps!