# Migrating from GitHub

> Copy a repository from GitHub with the importer, then configure the Git remotes to push to Tangled.

You can migrate your repositories, associated emails, and SSH keys from GitHub to Tangled using the [importer tool](https://tangled.org/repo/migrate). You can read more about the importer tool [here](/docs/guides/importing/). You may also migrate repositories without the importer.

## Using the importer tool

This is a quick and easy way to migrate most of your data from GitHub to Tangled:

1. Head to the [importer](https://tangled.org/repo/migrate).
2. Authorize the importer to grant read access to your GitHub account.
3. Configure repositories and migrate them!

The importer requries read-only access to your GitHub account, and you can revoke access once repositories are imported. If you wish to avoid the tool, you can also migrate without it, as done below.

## Without the importer tool

You can move a repository without the importer. Use a local clone.

1. Create an empty repository on Tangled. [Quick start](/docs/quick-start/) shows the procedure.

2. Open the repository on your computer.

   ```sh
   cd /path/to/your/repository
   ```

3. Show the current remote.

   ```sh
   git remote -v
   ```

   The output might look like:

   ```text
   origin  git@github.com:alice/my-project.git (fetch)
   origin  git@github.com:alice/my-project.git (push)
   ```

4. Set the remote URL to your Tangled repository.

   ```sh
   git remote set-url origin git@tangled.org:alice.tngl.sh/my-project
   ```

5. Push all branches and tags.

   ```sh
   git push origin --all
   git push origin --tags
   ```

All commits, branches and tags are now on Tangled.

## Pushing to GitHub and Tangled

To keep GitHub and Tangled in step, use one remote with two push URLs. Start with a repository whose remote points to GitHub. Git fetches from the first URL. Git pushes to both URLs.

1. Show the current remote.

   ```sh
   git remote -v
   ```

   ```text
   origin  git@github.com:alice/my-project.git (fetch)
   origin  git@github.com:alice/my-project.git (push)
   ```

2. Add the GitHub URL as the first push URL. Git then uses it to fetch only.

   ```sh
   git remote set-url --add --push origin git@github.com:alice/my-project.git
   ```

3. Add the Tangled URL as the second push URL.

   ```sh
   git remote set-url --add --push origin git@tangled.org:alice.tngl.sh/my-project
   ```

4. Show the result.

   ```sh
   git remote -v
   ```

   ```text
   origin  git@github.com:alice/my-project.git (fetch)
   origin  git@github.com:alice/my-project.git (push)
   origin  git@tangled.org:alice.tngl.sh/my-project (push)
   ```