Cant add folders to workspace

Whenever I create a codespace instance, by default the GitHub repository becomes the workspace directory, if I try to clone some other repo or any other folder and add that to the workspace, it is not working. It get backs to the previous workspace with just the initial GitHub repo.

Hey! While you can clone other repos inside the Codespace, we don’t currently have a mechanism to specify that you want a .code-workspace file to be the default entry point. As a workaround, you can open the Codespace, and then run code <workspace>.code-workspace from the terminal. That will reload the editor with your multiple directories open.

If you don’t have a .code-workspace file already, you can simply add multiple folders to the workspace, and then run File -> Save Workspace As... to create one. In the future, we’ll streamline this further, but let us know if this works for now :+1:

As an aside, I’d be curious to hear what your use case is for needing to clone the second repo. Are you working on a multi-repo app and you want to be able to develop against them both at the same time?

Hey! Whenever I try to add a folder to the current workspace, the page reloads and goes back the original state with the cloned repo. Even I tried code <folder_name>, doing that also resulted in the same response.

Yeah I was working on a full stack app for which the backend and frontend was on two different repos, and also I might need to refer the old repos.

I feel it’d be great if there’s a way to make the workspace folder as the workspace, instead of workspace/<cloned_repo> as the workspace.

Hey I don’t know what changed, I tried adding a folder right now and it works like a charm. Thanks for your help

1 Like

Great to hear! We’ll work to make this smoother in the near future, so that you don’t have to manually keep opening the workspace file.

1 Like