How to find and export your GitHub data.
GitHub measures a repository by its on-disk size, the compressed .git folder, and the REST API returns a size value for each repository. The exact number comes from a mirror clone of each repository plus any Git LFS objects. Report the total in GB; an organization owner can see and clone every repository.
Where GitHub shows how much you have.
- Sign in as an organization owner and open the organization's Repositories tab to list every repository.
- For a quick inventory, call the REST API endpoint GET /orgs/ORG/repos with a token that can read private repositories. Each repository in the response includes a size field.
- For an exact figure, run git clone --mirror on each repository, then run git count-objects -vH inside the clone. The size-pack line is the compressed size of the full history.
- If you use Git LFS, run git lfs fetch --all in each mirror and add the size of the LFS objects, since they are stored outside the Git history.
- Add the repositories together and convert the total to GB.
Plan and role. Organization owners can see and clone every repository in the organization. Members with read access can only measure the repositories they can read, which may miss private repositories.
What to report on the Polyshares intake.
Report GitHub in GB. The intake also asks how many years the company has used it and how many seats it has.
Report total repository size in GB, measured from mirror clones, and include Git LFS objects if you use them. GitHub defines on-disk size as the compressed .git folder, which is what a mirror clone contains.
For years in use, use the oldest commit date across your main repositories, which git log --reverse on the default branch shows first. For seats, count the members of the organization rather than outside collaborators.
Issues, pull requests and review comments are not part of a clone. If you plan to include them, mention it on the intake, since their volume is separate from the code size.
Export the full history.
- For each repository, run git clone --mirror with the repository URL. This copies every branch, tag and commit.
- If the repository uses Git LFS, run git lfs fetch --all inside the mirror, then compress the folder into a .zip or .tar.gz file. Wikis are Git repositories too and can be cloned the same way.
- To capture issues, pull requests, reviews and comments, an organization owner starts a migration with POST /orgs/ORG/migrations, listing the repositories to include.
- Check the migration until its state is exported, then download the archive, a tar.gz file of JSON data with attachments and Git data. Download it within seven days, after which GitHub deletes it.
- Personal account owners can export repositories they own the same way with the user migrations API.
A mirror clone includes every branch, tag and commit but not issues, pull requests, discussions or release files, which live outside Git.
Migration archives contain JSON for issues, pull requests, releases, repositories and users, plus attachment files. GitHub states they do not include Git LFS objects, discussions or packages, and there is no supported way to restore them on GitHub, so treat them as an archive. Options such as exclude_attachments and exclude_releases shrink the archive; leave them off for a complete copy.
Only organization owners can use the organization migrations API, and archives are deleted after seven days. GitHub recommends keeping repositories under 10 GB on disk, blocks files over 100 MB and limits pushes to 2 GB, which is why large binaries usually sit in Git LFS.
Git LFS includes 10 GiB of storage on GitHub Free and Pro and 250 GiB on GitHub Team and GitHub Enterprise Cloud. GitHub Enterprise Server customers can also export from their own instance with ghe-migrator.
The intake only needs the size, so you do not have to run an export to fill it in. You also do not need to clean or scrub an export. Polyshares handles anonymization before anything moves.
Why GitHub data has value for AI training.
A repository's history records every change with its author, timestamp and message. Paired with pull requests and review comments, it shows the proposed change, the reviewer's objection and the fix that followed, not only the final code.
Company codebases carry what public open source often lacks: internal frameworks, business rules, tests written after real incidents, and database migrations that show how a system evolved over years.
What stays private.
You pick which repositories are included, so infrastructure, security or experimental repositories can stay out.
We anonymize identifying details before anything moves. Polyshares does that work, so your team does not have to scrub records first.
Your company keeps ownership of its data. The license is bounded to defined material and a defined use.
Polyshares is the buyer and pays your company directly. There is no fee or commission, and Polyshares reviews the record before it makes any offer.
Common questions about GitHub data.
Does git clone --mirror include GitHub issues and pull requests?
No. A mirror clone copies Git data only: branches, tags and commits. Issues, pull requests and review comments come out through a migration archive from the migrations API.
Are Git LFS files included in a GitHub migration archive?
No. GitHub says migration archives do not include Git LFS objects. Fetch them with git lfs fetch --all in a mirror clone.
How long can we download a GitHub migration archive?
Seven days. GitHub deletes migration archives after seven days, and you can delete them sooner.
Who can run a GitHub organization export?
Only organization owners can use the organization migrations API. Personal account owners can use the user migrations API for their own repositories.
Source: Backing up a repository, REST API endpoints for organization migrations, Repository limits. Checked September 2026.
Related
- GitLabUsage quotas page for storage; project export includes issues and merge requests
- BitbucketSize line on Repository details; mirror clone for full commit history
- Azure DevOpsRepositories REST API or git count-objects for size; mirror clone and CSV work items
- All data source guidesEvery system on the Polyshares intake, grouped by category.
Put your numbers on the intake.
List your systems, their sizes and your headcount in one intake. Polyshares reviews the record and prices it. There is no fee or commission to your company.
Check your data