This dotfiles setup automatically creates a VS Code workspace that includes multiple repositories, allowing you to work with several related projects simultaneously in a single workspace.
When you start a new Gitpod workspace, the install.sh
script:
- Configures additional repositories: You can specify multiple GitHub repositories in the
additional_repos
array - Clones repositories: Automatically clones the specified repositories as siblings to your main dotfiles repository
- Creates dynamic workspace: Generates a temporary
.code-workspace
file that includes all repositories as folders - Opens multi-repo workspace: Opens VS Code with all repositories accessible in a single workspace
- Fork this repository to your own account (direct link)
- Edit the
install.sh
file and modify theadditional_repos
array to include your desired repositories:local additional_repos=( "https://github.com/your-username/repo1" "https://github.com/your-username/repo2" # Add more repositories as needed )
- Go to https://gitpod.io/user/preferences and scroll down. (You may replace
gitpod.io
with your own instance domain) - Copy your forked repo link and set it as Dotfiles - Repository URL and click on
Save
. - Create new workspace to see in action.
If you don't want to tell users to configure this individually via dotfiles, you can add this to your org default workspace image
You need to add the following lines to the source dockerfile used to build your image:
RUN <<EOR
multi_repo_script="$(curl -sL https://raw.githubusercontent.com/gitpod-samples/dotfiles.auto_multi-repo/240045be705601419e9a10d1237e908e8b51b042/install.sh | tail -n +2) >/tmp/multi-repo.log 2>&1 &"
sudo tee -a /etc/bash.bashrc <<BASH
if mkdir /tmp/.multi-repo.lock 2>/dev/null; then
$multi_repo_script
fi
BASH
EOR
You can see example.Dockerfile for a full reference.