You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/search-github/searching-on-github/finding-files-on-github.md
+36-2Lines changed: 36 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,18 +17,52 @@ topics:
17
17
18
18
**Tips:**
19
19
20
-
-File finder results exclude some directories like `build`, `log`, `tmp`, and `vendor`. To search for files within these directories, use the [`filename` code search qualifier](/search-github/searching-on-github/searching-code#search-by-filename).
20
+
-By default, file finder results exclude some directories like `build`, `log`, `tmp`, and `vendor`. To search for files in these directories, use the [`filename` code search qualifier](/search-github/searching-on-github/searching-code#search-by-filename).{% ifversion file-finder-exclusion-controls %} Alternatively, you can customize which directories are excluded by default [using a `.gitattributes` file](#customizing-excluded-files).{% endif %}
21
21
- You can also open the file finder by pressing `t` on your keyboard. For more information, see "[Keyboard shortcuts](/articles/keyboard-shortcuts)."
22
22
23
23
{% endtip %}
24
24
25
+
## Using the file finder
26
+
25
27
{% data reusables.repositories.navigate-to-repo %}
4. In the list of results, click the file you wanted to find.
31
33
34
+
{% ifversion file-finder-exclusion-controls %}
35
+
36
+
## Customizing excluded files
37
+
38
+
By default, file finder results do not include files in the following directories if they exist at your repository root:
39
+
40
+
-`.git`
41
+
-`.hg`
42
+
-`.sass-cache`
43
+
-`.svn`
44
+
-`build`
45
+
-`dot_git`
46
+
-`log`
47
+
-`tmp`
48
+
-`vendor`
49
+
50
+
You can override these default exclusions using a `.gitattributes` file.
51
+
52
+
To do this, create or update a file called `.gitattributes` in your repository root, setting the [`linguist-generated`](https://github.com/github/linguist/blob/master/docs/overrides.md) attribute to `false` for each directory that should be included in file finder results.
53
+
54
+
For example, the following `.gitattributes` file would cause files in the `build/` directory to be available to the file finder:
55
+
56
+
```
57
+
build/** linguist-generated=false
58
+
```
59
+
60
+
Note that this override requires the use of the recursive glob pattern (`**`). For more information, see "[pattern format](https://git-scm.com/docs/gitignore#_pattern_format)" in the Git documentation. More complex overrides of subdirectories within excluded-by-default directories are not supported.
61
+
62
+
{% endif %}
63
+
32
64
## Further reading
33
65
34
-
- "[About searching on GitHub](/search-github/getting-started-with-searching-on-github/about-searching-on-github)"
66
+
- "[About searching on GitHub](/search-github/getting-started-with-searching-on-github/about-searching-on-github)"{% ifversion file-finder-exclusion-controls %}
67
+
- "[Customizing how changed files appear on GitHub](/repositories/working-with-files/managing-files/customizing-how-changed-files-appear-on-github)"
68
+
-[`.gitattributes`](https://git-scm.com/docs/gitattributes) in the Git documentation{% endif %}
0 commit comments