Skip to main content
Documentation

Migrating from Git to Dits

A step-by-step guide to migrating your Git repositories to Dits while preserving history and maximizing the benefits of content-addressed storage.

Migration Options

Quick Start (New Repo)
Start fresh, import history later if needed

Best for:

  • Projects with large binary files
  • When Git history isn't critical
  • Fastest migration path
Full History Import
Preserve complete Git history in Dits

Best for:

  • When history is valuable
  • Compliance requirements
  • Long-running projects

Quick Start Migration

For projects where you want to start fresh with Dits:

# 1. Initialize new Dits repo alongside existing project
cd your-project
dits init

# 2. Copy your .gitignore to .ditsignore
cp .gitignore .ditsignore

# 3. Add all files
dits add .

# 4. Create initial commit
dits commit -m "Initial commit: migrated from Git"

# 5. Add remote and push
dits remote add origin https://dits.example.com/your-project
dits push origin main

Full History Migration

To preserve your complete Git history:

# 1. Import Git repository with full history
dits import git ./your-git-repo --full-history

# This will:
# - Convert all Git commits to Dits commits
# - Chunk and deduplicate all file versions
# - Preserve commit messages, authors, and dates
# - Convert Git branches and tags

# 2. Verify the import
dits log --oneline -20  # Check recent commits
dits branch -a          # Check branches
dits tag -l             # Check tags

# 3. Add remote and push
dits remote add origin https://dits.example.com/your-project
dits push origin main --all --tags

Command Comparison

Git CommandDits EquivalentNotes
git initdits initIdentical
git clonedits cloneAdd --filter for sparse
git adddits addIdentical
git commitdits commitIdentical
git pushdits pushIdentical
git pulldits pullIdentical
git lfs track(automatic)All files chunked automatically
git lfs pulldits mountOn-demand access

Migrating Git LFS

If you're using Git LFS, Dits handles large files natively:

# 1. In your Git repo, fetch all LFS files
git lfs fetch --all

# 2. Import to Dits
dits import git . --full-history --include-lfs

# LFS pointer files are automatically converted
# to regular Dits chunks

# 3. Verify large files
dits ls-files --large  # List files > 10MB

Configuration Migration

.gitignore → .ditsignore

# Copy your gitignore (syntax is identical)
cp .gitignore .ditsignore

# Or use the same file for both during transition
ln -s .gitignore .ditsignore

Git Config → Dits Config

# Set user info (same as Git)
dits config --global user.name "Your Name"
dits config --global user.email "you@example.com"

# Set default branch
dits config --global init.defaultBranch main

# Editor preference
dits config --global core.editor "code --wait"

Team Migration Checklist

Before Migration

  • Ensure all team members have pushed their work
  • Document current branch structure and release process
  • Set up Dits server or Ditshub account
  • Install Dits CLI on all team machines

Migration Steps

  • Import repository with full history
  • Push to new Dits remote
  • Update CI/CD pipelines
  • Update documentation and READMEs

After Migration

  • Have team clone fresh from Dits
  • Archive old Git repository (read-only)
  • Train team on new features (VFS, proxies, P2P)

Related Resources