Move from GitHub / Import
Import from GitHub
Your repository is on GitHub, with years of issues and pull requests. You want to move it to TanStack Source and lose nothing.
6 min read
The import copies the git history and every issue and pull request. They keep their GitHub numbers, so #123 still points at the same item.
Other ways to import:
- Many repositories, or a whole GitHub organization with its profile and image: Import a GitHub organization.
- With your coding agent, or with
src import: Import from GitHub with your agent. - From another git host: Import from another git host.
1. Start the import
- Open New repository, and turn on Import from GitHub.
- If the form shows Connect GitHub, click it. To see private repositories, tick Private repositories too first. GitHub asks you to allow access, then sends you back to the form.
- In GitHub repository, type a part of the name, and pick the repository from the list.
- Keep Import issues and pull requests on.
- Check the Owner and the Repository name, then click Begin import.
If the repository is missing from the list, enter its full owner/repo name, and click Find owner/repo on GitHub. This checks the repository directly with your connection. If GitHub refuses it, check the private repository access and the OAuth app approval of the organization.

The list hides each GitHub repository that the Owner of the form already has here, with the same name in any letter case. When you change the owner, the list changes.
The form uses the GitHub name, and makes the copy private when the repository is private on GitHub. You can add up to 10 Topics, separated by commas or spaces.
Tip
The import is a copy. To also get what happens on GitHub after the import, turn on Keep in sync with GitHub in the same form. See Sync with GitHub.
2. Watch the progress
The repository page shows each step of the import. 2,000 issues and pull requests take a few minutes.
After the listing of the branches and tags, the import has one step for the git history. The git servers of the forge fetch the whole history, and git checks each object. The import has these limits:
- The URL must start with
https://. Anhttp://URL is refused before the repository is made. - The history can be up to the size limit of the repository (20 GiB by default).
- The fetch can take up to 3 hours.
- Each git server fetches 2 imports at a time. The other imports wait for their turn. While an import waits or fetches, its page shows
0 of <n> branches and tags fetched.
Note
If GitHub's rate limit stops the import, the import waits for the reset. Then it continues from the last saved item. A rate limit is not a failure, and a deploy of Source during the import is not a failure either: the import goes on at once.
If the import fails, the repository page shows why, and what to do next. See Retry a failed import.
3. Point your clone at the forge
Install src and log in (steps 2 and 3), or let your agent do it: Set up your coding agent. Then, in your clone:
git remote set-url origin https://source.tanstack.com/@<owner>/<repo>.git
git fetch origin
A teammate with no clone does the same login steps, then runs src repo clone <owner>/<repo>. Real git on the forge's git servers answers the clone. The clone of a public repository can start with a bundle of the default branch from the CDN.
4. Keep using the gh commands
src takes the commands and flags of gh. Add an alias, and your habits stay the same.
In bash or zsh:
alias gh=src
In PowerShell:
Set-Alias gh src
To keep the alias, add the same line to ~/.bashrc, ~/.zshrc or your PowerShell $PROFILE. src help support lists the commands that work now.
Done
Your repository, its issues and its pull requests are on TanStack Source, and git push goes there. If a push is too large for one request, push it with src repo push.
Next: Switch from GitHub has the other steps of the move: CI, branch rules, your team and your agents.
What comes over
- Copied: comments, reviews, line comments, replies, resolved threads, labels and assignees. The import reads review threads and replies in small pages first, and reads the other pages only when GitHub has more.
- Events: closed, reopened, merged, renamed, labeled and assigned.
- People: a GitHub person who signs in to Source with GitHub, or connected GitHub for sync, shows as their account here, with its avatar. Every other GitHub person shows as their GitHub login and GitHub avatar, with a link to their GitHub profile.
- Shown at once: every issue, pull request and comment shows as soon as it comes over. The import holds nothing for screening, because GitHub showed these items already.
- Large files: a file can be up to 128 MiB. GitHub refuses files over 100 MiB, so every file of a GitHub repository comes over.
The GitHub connection
You connect GitHub one time. Source keeps the connection in Settings, Connected accounts. The import, Resume, Try again and sync all use it.
- The import uses your GitHub connection, so you paste no token.
- The forge keeps a copy of the token encrypted while the import runs, then deletes that copy.
- Sync uses the same connection. See Sync with GitHub.
Restarts during an import
A Git download survives a Worker restart or a deploy:
- Source saves the refs that it found on the remote before the download.
- The primary git server downloads the git, apart from the requests of the Worker. After a restart, the next step of the import asks the git server again, and gets the result when the download ends.
- When the git server itself restarts during a download, the next step starts the download again, and the git server first deletes what the stopped download left.
A download that did not finish is fetched again.