Skip to content
Source
Sign inSign up

Browse the code

Code and repositories / Read code

Browse the code of a repository

You open a repository to find a file, read it, and learn if you can use the code. Find your job below, and open its page.

4 min read

Find your job

You want toRead
See only some files, or only the files of one ownerFilter the files of a repository
Move between folders, and keep your placeMove through a repository with the file tree
See an image as a picture, or step through the commits of a fileRead a file and its history
Know what the icons, the faded rows and the folded rows meanRead the file list
Know if you can use the codeSee the license of a repository
Go to one part of a long READMEJump to a part of the README
Get the files of a branch, a tag or a commit as one ZIP or tar.gz fileDownload a ZIP of the code
Find the branches that nobody usesFind and delete old branches

Limits of big folders and long histories

A folder can hold thousands of files, and a history can hold many thousands of commits. To keep the pages fast, a code page shows the files first. The latest commit, the commit count and the last commit of each row load right after, and gray bars hold their place until they do. The branch and tag switcher loads its list when you open it.

The git servers of the forge read each folder and each history with git. Some parts stop at a limit:

PartLimitWhat the page shows
A folderIts first 1,000 entries, folders first, then by nameThe notice Showing the first 1,000 entries of this folder. above the list. The README of the folder still shows.
The commit count next to the latest commit1,000,000 commits1,000,000+ Commits
The last commit of each row of the file listThe 2,000 newest commits that changed the folderNo commit message and no date in the row
The History list of a file or a folder1,000 pages of 35 commitsPage 1,001 does not load.
A single commit1,000 changed files for a visitor who is not signed in. For a signed-in person, 200,000 changed files, or 16 MiB of their list (about 70,000 files).Too large to show in place of the changed files
The Branches pageThe 10,000 branches with the newest tip commitsThe other branches are not in the list, and the page does not say so.
The commits of a pull request250 commitsThe count with a +, for example 250+ commits

In a folder of more than 10,000 entries, the page reads only its first 10,000 entries in the order of git, which sorts the names by their bytes. The 1,000 entries that it shows, and the README, come from these.

The latest commit of a file or a folder, and each page of the History list, have no limit of commits: git walks the history as far back as it needs. The ahead and behind counts of the Branches page are exact.

A read of the history on the git servers stops after 30 seconds. When the read of the last commits stops, or the git servers are busy, the page says Could not load the last commits on a folder, or Could not load the last commit on a file, with the reason and Retry. Then the strip above the file or the file list says Open History to see the last commit.

The last commit of each row comes from one walk of the history, newest commit first. The walk ends when it has the last commit of each row, or after the 2,000 newest commits that changed the folder. A row whose last commit is older shows no commit message and no date. A later visit does not walk further back: the walk is the same each time.

To see all the files of a big folder, clone the repository. To find a last commit that the page does not show, click History, or run git log -1 -- <path> in a clone. To read the commits past page 1,000 of History, run git log -- <path> in a clone.

From tools, src repo read-dir, REST GET /api/v1/repos/{owner}/{repo}/contents/<path> and the MCP tool list_files list the same first 1,000 entries:

  • REST and MCP answer truncated: true when the folder has more.
  • src prints a notice, and its --json output has truncated.