Code and repositories / Read code
Filter the files of a repository
A big folder has many files, and you want to see only the .ts files, or hide the dot folders like .github and .vscode. The Filter button above the file list shows only the names that you want, so you find the code faster.
4 min read
1. Open the filter
Open a repository, or a folder in it. Above the file list, click Filter.
2. Type your patterns
- Show only: the file names to show, for example
*.ts. A folder stays when a file below it matches. - Hide: the file and folder names to hide, for example
.*/, node_modules/.
Put commas between the patterns. Then click Apply. The list shows only the names that pass.

3. Write a pattern
| Pattern | What it matches |
|---|---|
*.ts | Names that end in .ts |
.env | Names that contain .env, like .env and .env.local |
.*/ | Folders with a name that starts with a dot (in Hide) |
node_modules/ | Folders with a name that contains node_modules (in Hide) |
- Text without
*matches each name that contains it. Uppercase and lowercase are the same. - Text with
*must match the full name.*matches any text, and uppercase and lowercase are different. - A
/at the end of a Hide pattern matches folders only. - A pattern matches a name, never a path. So
src/*.tsmatches nothing.
Note
With Show only, a folder stays only when a file below it matches and is not hidden. In a repository with 10,000 files or more, every folder stays, in the file list and in the file tree. When you are not signed in, every folder stays in the file tree, in a repository of any size.
4. Keep or clear the filter
- The filter is in the URL. When you send the link, the other person sees the same list.
- The filter stays when you open a folder, or when you change the branch.
- The file tree next to the code follows the same filter.
- This browser remembers the last filter of each repository. When the URL has no filter, that filter comes back.
- To remove the filter, click Filter, then Clear.
Filter by owner
You want to see only the files of one person or one team. Or you want to find the files that nobody owns.
- Click Filter.
- In Owner, pick a choice from the table below.
- Click Apply.
| Choice | What shows |
|---|---|
| Anyone | The owner does not filter. This is the default. |
| Any owner | The files with an expert or a code owner |
| No owner | The files with no expert and no code owner |
| A person, under People | The files of that person |
| A team, under Teams | The files of that team |

With the owner carol, the folder src shows only the folder web, and the file tree shows only the files that carol owns:

The owner works together with Show only and Hide. A folder stays only when a file below it passes. The URL keeps the owner: ?owner=ana, ?owner=@acme/core, ?owner=:any or ?owner=:none.
Note
In a repository with 10,000 files or more, the owner does not filter the file list or the file tree. When you are not signed in, the owner does not filter the file tree, in a repository of any size.
Who owns a file
- A person owns the files of their expert entry, and the files whose CODEOWNERS rule names them. A rule that names their team does not count. To see those files, pick the team.
- A team owns the files whose CODEOWNERS rule names the team.
- The rule of a file is the last rule of the CODEOWNERS file that matches it, on the branch that you see.
Done
The file list shows only the files that you want. The Filter button shows how many filters are on: one for each pattern, and one for the owner.

Vault files in the list follow the same filter (see Keep private files out of git). To learn the icons, the faded rows and the folded rows of the list, see Read the file list.