Skip to content
Outrich Data

Export guide · Checked against GitHub documentation 2026-11-17

How to export your repositories, issues and pull requests from GitHub

An organization owner can export repositories with their issues, pull requests and other metadata by starting an organization migration through the REST API, then downloading the migration archive as a tar.gz file. Archives are deleted after seven days. A mirror clone captures Git history alone, and individuals can export personal account data from Settings.

Who can export from GitHub

The organization migrations endpoints are available only to authenticated organization owners. GitHub's export guide asks for owner permissions on the source organization's repositories and an access token with the repo and admin:org scopes.

A mirror clone needs only the ability to clone the repository. It captures the Git data and nothing else, so issues and pull request conversations are not in it.

Any user can request an archive of their own personal account from Settings. That export covers the repository and profile metadata from the personal account's activity. It is not a route to a company's organization data.

How to export, step by step

Route 1 of 3

Organization migration archive (REST API)

Organization owner with an access token that has the repo and admin:org scopes.

  1. 01Notify organization members that an export is about to run.
  2. 02Send a POST request to https://api.github.com/orgs/ORG_NAME/migrations with the list of repositories, written as ORG_NAME/REPO_NAME.
  3. 03Set lock_repositories to true if the repositories are in use and you want a consistent copy.
  4. 04Note the id returned in the response.
  5. 05Send a GET request to https://api.github.com/orgs/ORG_NAME/migrations/ID until the state is exported.
  6. 06Send a GET request to https://api.github.com/orgs/ORG_NAME/migrations/ID/archive, following the redirect, and save the response as a tar.gz file.
  7. 07Unlock each locked repository with a DELETE request to /orgs/{org}/migrations/{migration_id}/repos/{repo_name}/lock.
  8. 08Optionally send a DELETE request to the archive endpoint to remove the archive before it expires.

Locking prevents all write access to a repository, and new teams or collaborators cannot be added while it is locked. The states are pending, exporting, exported and failed. Optional flags shrink the archive: exclude_attachments, exclude_releases, exclude_metadata, exclude_git_data and exclude_owner_projects.

Route 2 of 3

Mirror clone (Git history only)

Anyone who can clone the repository.

  1. 01Run git clone --mirror https://github.com/EXAMPLE-USER/REPOSITORY.git.
  2. 02Run git lfs fetch --all if the repository uses Git Large File Storage.
  3. 03Clone the wiki separately, since wikis are stored as Git repositories.
  4. 04Archive each clone as a .zip or .tar.gz file and store it.

To restore, decompress the archive and push the repository to a Git remote.

Route 3 of 3

Personal account export

Any user, for their own account.

  1. 01Click your profile picture, then click Settings.
  2. 02In the left sidebar, click Account.
  3. 03Under Export account data, click Start export or New export.
  4. 04Wait for the email GitHub sends to your primary email address.
  5. 05Click the link in the email and re-enter your password if prompted.
  6. 06Download the tar.gz file from the page you are redirected to.

The archive reflects the data stored when the export started. You can delete an export from the same section of Settings before its link expires.

What comes out

A migration archive is a single tar.gz file. By default it carries both the Git data and the metadata for the repositories you listed. Setting exclude_metadata leaves only the Git source, and setting exclude_git_data leaves only the metadata. The org_metadata_only flag produces an archive of organization metadata with no repositories.

GitHub's ghe-migrator documentation lists the data a migration carries with a repository: users, the organization's name and details, repositories, wikis, teams, milestones, issues and pull requests with their timestamps, issue comments, pull request reviews and review comments, commit comments, releases, the recorded actions on issues and pull requests such as assignments, renames and label changes, file attachments, active webhooks, deploy keys and protected branch settings.

A mirror clone is a bare Git repository with the full revision history. It contains commits, branches and tags but no issue or pull request discussion. The personal account export is also a tar.gz file. GitHub's page does not describe its internal layout, so inspect the archive before building anything on it.

In the exportWhat it contains
Migration archive (tar.gz)Git data plus metadata for the listed repositories, unless a flag excludes one or the other.
Issues and pull requestsIssues, pull requests and milestones with timestamps preserved, plus the recorded actions on them.
Comments and reviewsIssue comments, pull request reviews, review comments and commit comments.
Releases and attachmentsRelease data and the files attached to issues and pull requests, unless excluded with the flags.
Wikis and settingsWiki data, active webhooks, deploy keys and protected branch settings.
Mirror cloneThe complete Git history of one repository. LFS objects are added by git lfs fetch --all.
Personal account archiveRepository and profile metadata from one personal account's activity.

Before you rely on it

Limits and gotchas.

  • Migration archives are deleted automatically seven days after creation.
  • GitHub states that migration archives do not include all data related to a repository. Git LFS objects, discussions and packages are not included.
  • There is no supported, documented way to restore a migration archive on GitHub, so GitHub describes them as suitable only for archiving.
  • Fork relationships do not persist, only active webhooks are carried, and file-level comments are not migrated.
  • For migrations between GitHub products, GitHub lists further data that is not migrated, including audit logs, Projects, GitHub Actions secrets, variables and workflow run history, repository stars and watchers, and rulesets. Plan separate exports for anything on that list you need.
  • The download link for a personal account export expires after seven days.
  • The repository list returned for a migration appears only for exports, and each locked repository stays locked until you unlock it.

Handle with care

Personal data inside a GitHub export.

  • User records carried in the migration data, and the usernames attached to every issue, pull request, comment and review.
  • Commit author names and email addresses in the Git history.
  • The text of issues, pull requests and comments, which can name customers and quote their messages.
  • Files attached to issues and pull requests, such as screenshots and logs.
  • Team names and the organization's details.
  • Profile metadata in a personal account export.

An export is a copy outside the access controls of GitHub. Store it encrypted, limit who can open it and delete working copies when you are done. The personal data scrubber removes common identifiers in your browser before a file is shared.

What the export can be worth

Outrich Data is a direct buyer of de-identified company data for AI training, from companies with 50 or more employees. We never connect to your GitHub account: your team runs the export above and removes what is out of scope. Not every export qualifies, and a rights review comes before any offer.

Questions

Exporting from GitHub: common questions.

How do I export issues and pull requests from a GitHub organization?
Start an organization migration through the REST API as an organization owner, naming the repositories to include. When the migration state is exported, download the archive. It carries issues, pull requests, comments, reviews, milestones and releases alongside the Git data.
How long is a GitHub migration archive available?
Seven days. GitHub deletes migration archives automatically seven days after creation, and you can delete one sooner with a DELETE request to the archive endpoint.
Does git clone --mirror back up issues and pull request comments?
No. A mirror clone captures the full repository, including revision history. Issues, pull request conversations, releases and attachments are metadata held by GitHub, and they come out through a migration archive.
Can a GitHub migration archive be imported back into GitHub.com?
GitHub says there is no supported, documented way to restore migration archives on GitHub. The archives are designed for moving data between GitHub products and are otherwise suitable only for archiving.

Steps were checked against GitHub documentation on 2026-11-17. Vendors change menus, plans and limits, so confirm against the linked pages. GitHub is a trademark of its owner. Outrich Data is not affiliated with GitHub.

Find out if your data qualifies.

Eleven questions, about five minutes, no call required. You get an answer on screen and a written follow-up.

esc