Skip to content

Commit 951b79d

Browse files
authored
Document .gitignore impact on unlinked files search (#594)
* Document .gitignore impact on unlinked files search * Change header level for .gitignore section * Fix formatting in findunlinkedfiles.md
1 parent 5a95ff7 commit 951b79d

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

en/collect/findunlinkedfiles.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,54 @@ This information is partially outdated. Please help to improve it ([how to edit
6565
The imported entries may need some editing because all the information gathered from the PDF files may not be accurate (see below "PDFs for which it works").
6666
{% endhint %}
6767

68+
## How .gitignore affects “Find unlinked local files”
69+
70+
JabRef’s “Find unlinked local files” feature respects `.gitignore` files.
71+
A `.gitignore` file is a small text file where you list file names or patterns you don’t want to see; tools that support it (like Git and JabRef) skip those files during searches.
72+
73+
## What JabRef does
74+
75+
- Looks for an applicable `.gitignore` in the directory being scanned and applies its patterns.
76+
- Interprets patterns relative to the directory that contains the `.gitignore`.
77+
- Applies all patterns (not “first match wins”).
78+
- Also ignores the `.git` directory and common OS metadata by default, and ignores the `.gitignore` file itself.
79+
80+
## Notes about pattern behavior
81+
82+
- Patterns are matched against the path relative to the `.gitignore`’s directory.
83+
- Patterns like `ignore/*` and `ignore/**` work as in Git to ignore a named subdirectory and its contents.
84+
- Patterns starting with `**/` (for example, `**/*.png`) also match files in the top directory for convenience, so PNGs are ignored both in subdirectories and at the base level.
85+
86+
## Examples
87+
88+
Ignore all PNG images everywhere:
89+
90+
```gitignore
91+
*.png
92+
```
93+
94+
Ignore a specific subdirectory named ignore (and everything inside, including nested folders):
95+
96+
```gitignore
97+
ignore/*
98+
ignore/**
99+
```
100+
101+
Ignore PDFs in any subfolder (and also at the base directory):
102+
103+
```gitignore
104+
**/*.pdf
105+
```
106+
107+
## Tips
108+
109+
- Place a `.gitignore` file in the folder you start the search in (or deeper) to control what is scanned.
110+
- If you use multiple `.gitignore` files in different subfolders, each one applies to the files under its directory.
111+
112+
This behavior mirrors Git’s expectations in practice, while making it straightforward to exclude unneeded files from the unlinked-files search.
113+
114+
115+
68116
## Further information
69117

70118
### PDFs for which it works

0 commit comments

Comments
 (0)