Import a Git repository

Bringing history, branches, tags and authors across with tovio git import.

Written By Dustin

Last updated 28 minutes ago

Import needs an empty repository

Import refuses to run into a repository that already holds any lane, so that imported history can never tangle with commits you made by hand. The sequence is two steps:

mkdir my-project-toviocd my-project-toviotovio inittovio git import /path/to/the/git/repo

The source argument defaults to the current directory, so running tovio git import from inside a Git checkout that is also a fresh TOVIO repository works too. This is one-way: TOVIO reads Git's object database and builds TOVIO objects from it. Your Git repository is never written to.

The flags

tovio git import <source> --mailmap authors.txttovio git import <source> --anonymizetovio git import <source> --no-repack
  • --mailmap <file> canonicalizes commit identities by email before import, using a git-style mailmap file.
  • --anonymize replaces every imported author with a stable, email-free pseudonym. It is a privacy import: it changes commit addresses, but never change ids.
  • --no-repack skips the post-import repack. See below before you reach for it.

Why the repack is on by default

Loose object count, not repository size, is what makes a freshly imported repository feel slow: every status, log and diff pays a directory walk linear in it. A large history can land well over a hundred thousand loose objects, and the difference between packed and unpacked is minutes per command versus seconds.

The repack is not free — on a big history it can take longer than the import itself. For a throwaway or scripted import, pass --no-repack and run tovio gc --repack later when it suits you.

What the report tells you

Import prints, and with --json emits, a census: commits translated, lanes created, tags imported, and the ones it could not take. Read the skips.

  • Skipped branches — a Git branch whose name is not a valid lane name.
  • Skipped tags — a tag whose name the ref guard rejects, or whose target is not one of the imported commits (an annotated tag pointing at a blob, for instance).
  • Symlinks and submodules preserved — both are kept as tracked entries, listed so you know they are there.

HEAD is pointed at the Git repository's current branch when that branch was imported. If the source HEAD was detached, HEAD falls back to the first imported lane and says so rather than choosing silently.

When it fails

Import and bridge failures exit with status 21 and carry a TVO-MIG- code.

CodeMeans
TVO-MIG-002The target repository already has lanes. This is the common one. Import into a clean repository — tovio init in an empty directory, then re-run.
TVO-MIG-003The source has no commits to import. Point at a repository with history.

After importing

Run tovio log and spot-check a few commits, then tovio fsck to confirm the object store is coherent. Then read the two companion articles — what import carries over, and the dotfile default — before you make your first native commit.