I set up a test directory as shown below.
.
├── Chocolate.bib
└── pdfs
├── .gitignore
├── ignore
│ └── Keen_2001.pdf
└── Keen_2001.pdf
I added these lines to .gitignore (trying to cover potential syntax errors).
ignore/.*
ignore/*
ignore/**
ignore/**/*
I checked JabRef before and after running git init in the root directory. JabRef always found and auto-linked both copies of the pdf.
I could not find this option in the ‘Find unlinked files’ dialog or in preferences. As an alternative, I tried the ‘Use regular expressions’ search option for linked files, and could not find a pattern that excluded the ignore subdirectory. Look-around expressions and even plain capture groups don’t seem to work in this context. I might be missing something about how to use the *, **, ., and .. prefixes because I was not able to make any of these selectively identify only one copy of the pdf.
I checked JabRef’s documentation and did not find any information about .gitignore or the menu items under ‘File > Git’.