Trying out GitHub Codespaces

GitHub Codespaces provides the GitHub managed dev environments on the cloud.

I never thought I want to try this out till recently I am going to be away from my personal laptop for a long time.

Usually I don’t like to write code on GitHub. You could probably tell it if you knew my GitHub ID. This blog, however, changed my paradigm, as the code is managed on GitHub and I want to keep the habbit to write it.

I have two different GitHub accounts. One for myself, and one for work. Ahough I feel GitHub seems to want one person just having one account and using different email address to distinguish their different identities, I want to separate my work and life completely and also hope to reduce the risk of security incident (such as accidentally publish secret repos to the whole internet in my name), so I only have my GitHub account for work logged in on my work device and personal GitHub account on my own device.

This has been fine when I am at my home because I can easily access both devices, but it becomes a trouble when I start my holiday. To cope with any urgency, I only had my work laptop with me, so it becomes quite complicated if I want to configure it for my blog and remove those configurations after my holiday. Since the whole reason I have two separate accounts is to avoid unintended mistake from complicated operations, I think I should refrain from setting it up whenever I really do not need it.

Then I thought of Codespaces. I opened an incognito window in Chrome and logged in my personal GitHub account there, and I created a Codespaces environment from the repository webpage. The process of creation was just swift. I experienced a little glitch with some blob file (such as image) preview in the incognito mode, but generally it worked quite well (actually, the update in the previous AWS exam post was made in the Codespaces environment).

Now I am using another personal laptop I left in my parents' house writing this blog. This laptop was once used to try Arch Linux, but recently it was mainly used to play Stardew Valley. On whichever operating system, I had no handy IDE and git configured, which means there should have been a hassle before I could write any blog, but it has been avoided with Codespaces.

So this is how Codespaces looks like in the web. The Codespaces official website mentions you can also connect the Codespaces environment with IDEs of JetBrains and more.

GitHub Codespaces Editor Screenshot

You can also run the application in the terminal. Codespaces will automatically bind the port to 443 and assign a preview URL to you.

GitHub Codespaces App Preview

In my case, here are still some problems:

Generally, as a second tier solution when I have limited access to my personal devices (I could even use this on the public iMac in hotel, as this only requires a modern browser). I am generally satisfied with what could be done and how fast to set this up. Codespaces should be more powerful than what I have discovered so far, and I am keen to discover more in the future.