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.
Familiar Commands
Dits commands are designed to be familiar to Git users. Most workflows transfer directly with minimal changes.
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 mainFull 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 --tagsCommand Comparison
| Git Command | Dits Equivalent | Notes |
|---|---|---|
| git init | dits init | Identical |
| git clone | dits clone | Add --filter for sparse |
| git add | dits add | Identical |
| git commit | dits commit | Identical |
| git push | dits push | Identical |
| git pull | dits pull | Identical |
| git lfs track | (automatic) | All files chunked automatically |
| git lfs pull | dits mount | On-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 > 10MBNo More .gitattributes
Dits doesn't need special tracking for large files. All files are automatically chunked and deduplicated regardless of size.
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 .ditsignoreGit 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)
Keep Git Repo as Backup
We recommend keeping your Git repository as a read-only backup for at least 30 days after migration to ensure everything transferred correctly.
Related Resources
- Getting Started - First steps with Dits
- CLI Reference - Complete command documentation
- Workflows - Team workflow patterns