4.5 KiB
title, intro, redirect_from, versions, topics
| title | intro | redirect_from | versions | topics | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Finding files on GitHub | You can search for a file in a repository using the file finder. To search for a file in multiple repositories on {% data variables.product.product_name %}, use the {% ifversion code-search-code-view %}[`path` code search qualifier](/search-github/github-code-search/understanding-github-code-search-syntax#path-qualifier){% else %}[`filename` code search qualifier](/search-github/searching-on-github/searching-code#search-by-filename){% endif %}. |
|
|
|
{% tip %}
Tips:
- By default, file finder results exclude some directories like
build,log,tmp, andvendor. To search for files in these directories, {% ifversion code-search-code-view %}use thepathcode search qualifier{% else %}use thefilenamecode search qualifier{% endif %}.{% ifversion file-finder-exclusion-controls %} Alternatively, you can customize which directories are excluded by default using a.gitattributesfile.{% endif %} - You can also open the file finder by pressing
ton your keyboard. For more information, see "AUTOTITLE."
{% endtip %}
Using the file finder
{% ifversion code-search-code-view %} {% data reusables.repositories.navigate-to-repo %}
-
In the file tree view, click the {% octicon "filter" aria-hidden="true" %} Jump to file search bar. You can also find the {% octicon "filter" aria-hidden="true" %} Jump to file search bar at the top of the integrated file editor.
-
In the search bar, type the name of the file or directory you'd like to find.
-
In the list of results, click the file or directory you wanted to find. You can view the file path for a directory or file below each search result. {% else %} {% data reusables.repositories.navigate-to-repo %}
-
In the search field, type the name of the file you'd like to find.

-
In the list of results, click the file you wanted to find. {% endif %}
{% ifversion file-finder-exclusion-controls %}
Customizing excluded files
By default, file finder results do not include files in the following directories if they exist at your repository root:
.git.hg.sass-cache.svnbuilddot_gitlogtmpvendor
You can override these default exclusions using a .gitattributes file.
To do this, create or update a file called .gitattributes in your repository root, setting the linguist-generated attribute to false for each directory that should be included in file finder results.
For example, the following .gitattributes file would cause files in the build/ directory to be available to the file finder:
build/** linguist-generated=false
Note that this override requires the use of the recursive glob pattern (**). For more information, see "pattern format" in the Git documentation. More complex overrides of subdirectories within excluded-by-default directories are not supported.
{% endif %}
Further reading
- "AUTOTITLE"{% ifversion file-finder-exclusion-controls %}
- "AUTOTITLE"
.gitattributesin the Git documentation{% endif %}

