Monorepo for Tangled tangled.org
core docs src content docs migrating-from-github.md
2.7 kB · 107 lines
Markdown


title: Migrating from GitHub description: 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. You can read more about the importer tool here. 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.
  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 shows the procedure.

  2. Open the repository on your computer.

    cd /path/to/your/repository
    
  3. Show the current remote.

    git remote -v
    

    The output might look like:

    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.

    git remote set-url origin git@tangled.org:alice.tngl.sh/my-project
    
  5. Push all branches and tags.

    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.

    git remote -v
    
    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.

    git remote set-url --add --push origin git@github.com:alice/my-project.git
    
  3. Add the Tangled URL as the second push URL.

    git remote set-url --add --push origin git@tangled.org:alice.tngl.sh/my-project
    
  4. Show the result.

    git remote -v
    
    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)