wit repo command provides repository management operations, including transferring repositories between users and organizations.
Overview
Commands
transfer
Transfer repository ownership to another user or organization.Arguments
| Argument | Description |
|---|---|
owner/repo | Current repository path (e.g., alice/myproject) |
new-owner | Username or organization slug to transfer to |
Options
| Option | Description |
|---|---|
--org | Transfer to an organization (instead of a user) |
Examples
Example Output
Requirements
Permissions
To transfer a repository:- To a user: You must be the repository owner
- To an organization: You must be the repository owner AND an admin/owner of the target organization
Authentication
Repository transfer requires authentication:What Gets Transferred
When you transfer a repository, the following are preserved:| Item | Preserved? |
|---|---|
| All commits and branches | Yes |
| Tags | Yes |
| Pull requests | Yes |
| Issues | Yes |
| Collaborators | Yes |
| Settings | Yes |
| Webhooks | Yes |
| Stars | No |
| Forks | Remain linked |
Workflow Examples
Personal to Organization
Move a personal project to your company:Hand Off to New Maintainer
Transfer ownership of a project:Organizational Restructure
Move repositories between organizations:After Transfer Checklist
After transferring a repository, update:- Local git remotes (
git remote set-url origin ...) - CI/CD configurations (GitHub Actions, Jenkins, etc.)
- Documentation links
- Package registry references (npm, PyPI, etc.)
- Dependency URLs in other projects
- Bookmarks and saved links
- Deployment scripts
- Monitoring and alerting configurations
Error Handling
Common Errors
Repository not found
Repository not found
- Verify the repository path is correct
- Ensure you have access to the repository
- Check that you’re authenticated
User/Organization not found
User/Organization not found
- Verify the username or organization slug
- Use
--orgflag when transferring to an organization - Check that the target account exists
Permission denied
Permission denied
- Only repository owners can initiate transfers
- You need admin/owner role in the target organization
- Check your permissions in both source and target
Repository already exists
Repository already exists
- The target owner already has a repository with that name
- Rename one of the repositories before transferring
- Or delete the existing repository if it’s not needed
Authentication required
Authentication required
Best Practices
Notify collaborators
Notify collaborators
Before transferring, inform all collaborators about the upcoming change and the new URL they’ll need to use.
Update CI/CD first
Update CI/CD first
If possible, update CI/CD configurations before the transfer or have them ready to deploy immediately after.
Check dependencies
Check dependencies
If other projects depend on this repository, plan how you’ll update those references.
Test access after transfer
Test access after transfer
After transferring, verify that:
- Collaborators can still access the repository
- CI/CD pipelines work with new URLs
- Webhooks are firing correctly
Environment Variables
| Variable | Description |
|---|---|
WIT_TOKEN | Authentication token for API access |
Related Commands
wit collaborator- Manage repository collaboratorswit clone- Clone a repositorywit remote- Manage remotes