Setup and Collaboration using Github Codespaces

Setup and Collaboration using Github Codespaces

ยท

2 min read

If you haven't read my blog on the Power of GitHub Codespaces, do check it out (unleash the power of codespaces).
We have talked about its features, requirements and how can you use it in your favour ๐Ÿ˜Ž.

Now let's start with creating a codespace...

Creating your first CodeSpace.

  1. Navigate to the repository you want to work on, and click the <>Code button, then click the Codespaces tab.

  1. Click the ellipsis (...) at the top right of the Codespaces tab and select New with options. On the options page for your codespace, choose your preferred options from the dropdown menus.

  1. Click Create codespace.

Opening an existing codespace

  1. Navigate to the "Your codespaces" page at github.com/codespaces.

  2. To open a codespace in your default editor, click the name of the codespace.

  3. To open the codespace in an editor other than your default:

    1. Click the ellipsis (...) to the right of the codespace you want to open.

    2. Click Open in.

    3. Click Open in APPLICATION.

Screenshot of the "Open in" dialog box, with "Open in Visual Studio Code" highlighted

You can open the codespace in:

  • Your browser

  • Visual Studio Code

  • JetBrains Gateway

  • JupyterLab

If you choose Visual Studio Code or JetBrains Gateway, you must make sure you have installed the selected application on your local machine.

Customising your CodeSpace

The codespace we created using GitHub is the default docker image. So what we will do next is create a few configuration files so that we can customise the default image. Open the codespace in VS-Code.

  1. Access the Visual Studio Code Command Palette ( Command+Shift+P / Ctrl+Shift+P ), then start typing "dev container". Click Codespaces: Add Development Container Configuration Files.

    Screenshot of the "Codespaces: Add Development Container Configuration Files" option

  2. Click Show All Definitions.

    Screenshot of the "Show All Definitions" option

  3. Select the Ubuntu version to use.

    Screenshot of the 'Python 3' option

  4. Click the latest version of Ubuntu.

    Screenshot of the Python 3 version selection

  5. Select the additional features to install inside of the dev container, then click OK.

    Screenshot of additional features for 'dotnet'

  6. A devcontainer.json file is created and is opened in the editor.

Did you find this article valuable?

Support Kunal Verma by becoming a sponsor. Any amount is appreciated!

ย