Dynamically manage multiple git repositories in your Gitpod dev environment.
As a developer, I want to add/remove git repos from my dev environment as needed, and have that selection persist across new environments.
- On environment start: All repos listed in
MY_ADDITIONAL_REPOSare cloned to/workspaces/ - During development: Add or remove git working copies in
/workspaces/as needed - To persist changes: Run
save_repos_list.shto save your current repo selection
The repo list is stored as a semicolon-separated user secret (MY_ADDITIONAL_REPOS) that gets injected as an environment variable.
cd /workspaces
git clone https://github.com/owner/repo.git
save_repos_list.sh # persist for future environmentsrm -rf /workspaces/repo-name
save_repos_list.sh # persist for future environmentsecho $MY_ADDITIONAL_REPOS.devcontainer/clone_repos.sh- Clones repos fromMY_ADDITIONAL_REPOSon environment start.devcontainer/save_repos_list.sh- Saves current/workspaces/repos to user secret