Overview
If you have existing Git repositories that use the traditional single-worktree layout, you can migrate them to Repo Manager’s bare + worktree structure using therepo convert command.
What Happens During Conversion
The conversion process transforms your repository structure: Before conversion:- Moves
.gitto.bare- Preserves all Git history and configuration - Creates a
.gitfile - Points to.baredirectory for Git operations - Configures for worktree use - Sets
core.bareand remote fetch configuration - Creates branch-named subdirectory - Moves all working files into it
- Registers the worktree - Links the new directory structure with Git
- Sets upstream tracking - Maintains connection to remote branch
Step-by-Step Migration Guide
1. Navigate to Your Repository
2. Run the Convert Command
3. Review the Output
You’ll see confirmation of the conversion:4. Update Your Workflow
After conversion:- Your working files are now in a subdirectory named after your current branch
- You can create additional worktrees using
repo wt add <branch> - The
.baredirectory contains all Git history and should not be modified directly
Verification Steps
After converting, verify everything works correctly:Check Worktree Status
Verify Git Operations
Test Remote Operations
Create a New Worktree
Troubleshooting
”Not a git repository” Error
Problem:repo convert reports the directory isn’t a Git repository.
Solution: Ensure you’re in a directory with a .git folder:
“Already in worktree layout” Message
Problem: The repository has already been converted. Solution: No action needed. The repository is already using worktree layout.”Appears to be a worktree” Error
Problem: You’re trying to convert from inside a worktree, not the root repository. Solution: Navigate to the root repository directory (the one containing.git as a directory, not a file).
Detached HEAD State
Problem: Conversion fails because you’re in detached HEAD state. Solution: Check out a branch first:Uncommitted Changes
Problem: You’re worried about uncommitted changes during conversion. Solution: The conversion preserves all files and Git state. However, for peace of mind:File Permissions or Symlinks
Problem: Special files (symlinks, executable permissions) after conversion. Solution: Git preserves file metadata. Verify after conversion:Best Practices
- Convert before creating worktrees - Easier to manage from the start
- Commit or stash changes first - Clean working tree makes verification easier
- Test after conversion - Run tests to ensure nothing broke
- Update documentation - Let team members know about the new structure
- Consider CI/CD updates - Build scripts may need path adjustments
Rolling Back
If you need to revert to standard layout:- Remove all worktrees except the main branch
- Move files from the branch directory back to root
- Move
.bareback to.git - Update
.git/configto remove worktree settings