Skip to main content

Section B.5 Codespaces

I personally prefer doing Git-related things on my personal computer (offline) and then updating GitHub when I’m ready. To me, it helps avoid unnecessary merge conflicts and make sure that my edits are only committed and pushed when I’m ready.
However, you don’t have to work completely on your local computer. If you don’t want to have all of this software downloaded (perhaps you’re running out of storage space on your computer), there is another option: codespaces. This is hosted by GitHub 64  and creates an online, virtual instance of your code files. By creating a codespace, you are using a virtual machine which runs the VS Code and is automatically connected to your GitHub repo. Codespaces could be useful if you need to edit something quickly and/or don’t have access to your personal computer but make sure you create a branch before making a codespace.
If you choose to use this route, know that you are limited to 60 hours a month if you do not want to pay. You also should know that this is not available offline; an internet connection is required to work on a codespace.
So how do you make a codespace? It’s easy!
  1. Head to the Code tab of your GitHub repository.
  2. Technically optional: create a branch. But I recommend you create a branch to lower the chance of conflicts.
  3. Click on the “Code” button (as if you were going to copy the HTTPS link for cloning).
  4. In the box that pops up, click on the Codespaces tab. In this tab is a button that says “Create codespace on <branch-name>”. A codespace will generate (it may take some time) and should be ready to go as soon as it’s done.