THE GITHTML FIELD GUIDE

Find a GitHub file when Go to file does not show it

GitHub’s Go to file finder searches filenames and paths within a repository, but its default exclusions can hide directories such as build, log, tmp, and vendor. Confirm the selected repository and branch, then use a path-qualified code search or direct tree browsing when a file is absent. A missing finder result does not prove the file was deleted.

Choose filename search or content search

If you know the filename or part of its path, Go to file is a quick route through a large repository. If you remember a function name or phrase inside the file, code search is the better tool. Mixing those expectations can make a working finder appear broken because it is not searching the text you remember.

Open the intended repository and check the branch selector before searching. A file added only on a feature branch will not necessarily appear in the default branch’s tree. Likewise, a renamed directory can make an old partial path misleading. Use the visible full path under a result to distinguish similarly named files in tests, examples, and source.

Account for finder exclusions

The official documentation lists directories excluded by default and explains that attributes can customize this behavior. For a file under an excluded directory, use the documented path qualifier in code search or navigate directly through the repository tree. Do not change repository attributes merely to solve a one-time lookup without considering other users.

  1. Open Go to file, or use the documented t shortcut when focus is not inside another text field, and enter a distinctive filename fragment.
  2. If no result appears, verify the branch and spelling, then check whether the expected parent directory is among the finder’s exclusions.
  3. Use a query such as repo:OWNER/REPOSITORY path:vendor/library/config.json for a targeted search, then confirm the result’s actual file path and context.

Use history only after current-state checks

If the file is genuinely absent from the selected tree, inspect relevant commits, branches, or release versions. A stale link may refer to a path that was moved rather than deleted. Do not immediately create a replacement file or report data loss based on a finder miss.

For a support note, include the repository, selected revision, expected path, and the search method you tried. This helps distinguish an indexing or exclusion issue from a branch mismatch. If you need a comprehensive inventory, a verified local tree listing can provide a different view, subject to the history and refs available locally. The finder is a navigation convenience, not an authoritative audit of every path across all repository history.

  1. If you remember the symbol name but not the filename, switch to content search instead of repeatedly shortening the symbol in Go to file. The finder’s filename-oriented purpose explains the miss. Once content search identifies a candidate, verify its complete path before opening similarly named alternatives.
  2. For a file known to exist on a feature branch, navigate that branch’s tree directly if a search fallback returns default-branch results. Different navigation tools can cover different revision scopes. Compare the branch selector and actual tree rather than interpreting a search miss as deletion from the feature.

Sources and further reading

AI-assisted writing with source-linked guidance and illustrative examples. Read our editorial approach or report a correction.

All github documentation workflows guides →

Read as MarkdownAll guides

Find a GitHub file when Go to file does not show it · gitHtml