Using Dev Container Configuration
The Dev ContaineronCreateCommand
allows you to clone additional repositories when your environment starts. This method is particularly useful when you want to maintain the repository setup as part of your Dev Container configuration.
Add an onCreateCommand
entry to your .devcontainer/devcontainer.json
file:
Using Ona Automations
Alternatively, you can use Ona’s Automations to clone additional repositories. This approach offers more flexibility and can be combined with other automation tasks. Add a task to yourautomations.yaml
file:
Best Practices
When working with multiple repositories, consider the following best practices:- Clone repositories to
/workspaces
: Always clone additional repositories to/workspaces/repo-name
(whererepo-name
in that example is the name of your repo). Do this to avoid git tracking issues within your main repository - Use SSH keys or personal access tokens for authentication with private repositories
- Organize repositories in a consistent directory structure under
/workspaces
- Configure Git identity globally to ensure consistent commits across repositories
Troubleshooting
Common issues you might encounter:- Authentication failures: Ensure you have the correct permissions and authentication method
- Path issues: Use absolute paths when necessary
- Repository not found: Verify repository URLs and access permissions
Working with Multiple Repositories
Once your environment is set up:- Navigate between repositories using the file explorer or terminal
- Make changes in each repository independently
- Commit and push changes to each repository separately