Cloning Codio Projects from Git

For most of the projects in this course, the master version of the project will be stored in GitLab. So, to make changes to these projects, or potentially deploy them to a course, you’ll need to be able to clone these Git repositories into your own Codio projects. This guide will show you to how to do this.

1. Create a New Codio Project

In Codio, click the “My Projects” link to the left, then click the “New Project” button in the upper right.

On the page that appears, select the correct stack for the project. Most projects should specify a stack in their readme, but you may have to “read between the lines” a bit to get the correct stack. When in doubt, the latest version of the stack for that class should suffice.

You can also give your project a name and description.

Finally, you should make sure the project is private to you - this helps avoid any confusion.

New Codio Project

2. Delete Codio Project Contents

Once the project has been created, you’ll need to delete all of the Codio project’s contents. Specifically, you’ll need to delete everything in the /home/codio/workspace folder. However, Codio will not allow you to delete the folder itself.

To do this, I recommend opening a terminal and entering the following commands:

cd /home/codio
rm -rf workspace

You should see the following as output:

Delete Codio Workspace Contents

3. Clone Git Repository Onto Workspace Folder

Next, you’ll need to clone the Git repository onto the /home/codio/workspace folder. This can be a bit tricky.

First, make sure you have configured your SSH key by copying the public key generated by Codio into GitLab.

Next, find the “Clone with SSH” URL for the GitLab repository you wish to clone:

GitLab URL

Using that URL, enter the following commands into Codio’s terminal:

cd /home/codio
git clone <url> workspace

For the Codio Autograder Guide project, the output should be similar to the following:

Git Output from Cloning

4. Verify Everything Works

Once you have cloned the repository, you can then open the Guide in Codio and verify that all is well:

Successful Clone

If anything is broken, you can always delete this project and start over.

From here, you can make any changes to the project that are needed, and commit/push those changes back to GitLab. Make sure you are mindful of branches as well - many projects use specific branches for various uses, so review the available branches in GitLab before committing.