> Source URL: /resources/github-codespaces.guide
# GitHub Codespaces

## What is Codespaces?

GitHub Codespaces gives you a full code editor in your browser. It looks and works like VS Code (which Cursor is based on), but you don't need to install anything. Your code runs on GitHub's servers, not your computer.

This is useful if you're on a Chromebook or any machine where you can't install Cursor.

## When to use Codespaces vs Cursor

| Use Codespaces if...                        | Use Cursor if...                   |
| ------------------------------------------- | ---------------------------------- |
| You're on a Chromebook                      | You're on a Mac or Windows laptop  |
| You can't install software on your computer | You can install apps normally      |
| You need to work from a different computer  | You want built-in AI chat for help |

Codespaces doesn't have Cursor's AI chat built in, but the editor is otherwise very similar. You can still write code, use the terminal, and push to GitHub the same way.

---

## How to open a Codespace

1. Go to your repo on GitHub (github.com)
2. Click the green **Code** button
3. Switch to the **Codespaces** tab
4. Click **Create codespace on main**

A new browser tab opens with your editor. It takes about 30 seconds to load the first time.

That's it. You're now editing your project in the browser.

---

## The interface

Codespaces looks almost identical to Cursor:

- **File explorer** on the left -- your project files and folders
- **Editor** in the center -- where you write code
- **Terminal** at the bottom -- where you run commands

To open the terminal if it's not visible: View > Terminal (or press `` Ctrl+` ``).

---

## Making changes and pushing to GitHub

The workflow is the same as Cursor. The only difference is everything happens in your browser.

**1. Edit your files**

Click a file in the explorer, make changes, save with `Ctrl+S`.

**2. Commit**

Click the Source Control icon in the left sidebar (the branch icon). You'll see your changed files.

- Click `+` to stage files
- Type a commit message (e.g. "updated homepage")
- Click the checkmark to commit

**3. Push**

Click "Sync Changes" to push your commits to GitHub.

Or use the terminal:

```bash
git add .
git commit -m "updated homepage"
git push
```

---

## Important things to know

- **Your Codespace saves automatically** but you still need to commit and push to get your code onto GitHub. Auto-save only saves within the Codespace itself.
- **Free tier limits:** GitHub gives you about 60 hours/month of Codespaces time on the free plan. That's plenty for this class, but close your Codespace when you're done working to avoid using up time. It will stop automatically after 30 minutes of inactivity.
- **Closing vs stopping:** Closing the browser tab doesn't stop the Codespace. To actually stop it, go to github.com/codespaces and click the three-dot menu next to your Codespace, then "Stop codespace."
- **Your work persists** between sessions. When you reopen a stopped Codespace, everything is still there.

---

## Common problems

| Problem                          | Fix                                                                                                                       |
| -------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| Codespace is slow to load        | Normal for first launch. Wait 30-60 seconds.                                                                              |
| "You've used your monthly hours" | Stop unused Codespaces at github.com/codespaces. Ask an instructor if you're stuck.                                       |
| Terminal won't open              | Try View > Terminal from the menu bar, or press `` Ctrl+` ``                                                              |
| Changes disappeared              | You probably didn't commit and push before your Codespace stopped. Check your repo on GitHub to see what was last pushed. |

---

## Quick reference

| Action           | How                                                              |
| ---------------- | ---------------------------------------------------------------- |
| Open a Codespace | Green "Code" button on your repo > Codespaces tab > Create       |
| Save             | `Ctrl+S`                                                         |
| Open terminal    | View > Terminal or `` Ctrl+` ``                                  |
| Commit           | Source Control sidebar > stage files > write message > checkmark |
| Push             | "Sync Changes" button or `git push` in terminal                  |
| Stop a Codespace | github.com/codespaces > three-dot menu > Stop                    |


---

## Backlinks

The following sources link to this document:

- [GitHub Codespaces](/resources/index.resources.llm.md)
- [GitHub Codespaces Guide](/ai-and-enterainment/weeks/week-3.module.llm.md)
- [GitHub Codespaces Guide](/users/annie-h/week-5.path.llm.md)
- [GitHub Codespaces Guide](/users/charlie-m/week-5.path.llm.md)
- [GitHub Codespaces Guide](/users/emily-kate-s/week-5.path.llm.md)
- [GitHub Codespaces Guide](/users/josiah-c/week-5.path.llm.md)
- [GitHub Codespaces Guide](/users/john-p/week-5.path.llm.md)
- [GitHub Codespaces Guide](/users/jake-f/week-5.path.llm.md)
- [GitHub Codespaces Guide](/users/elizabeth-b/week-5.path.llm.md)
- [GitHub Codespaces Guide](/users/annie-h/week-4.path.llm.md)
- [GitHub Codespaces Guide](/users/charlie-m/week-4.path.llm.md)
- [GitHub Codespaces Guide](/users/elizabeth-b/week-4.path.llm.md)
- [GitHub Codespaces Guide](/users/josiah-c/week-4.path.llm.md)
- [GitHub Codespaces Guide](/users/emily-kate-s/week-4.path.llm.md)
- [GitHub Codespaces Guide](/users/john-p/week-4.path.llm.md)
- [GitHub Codespaces Guide](/users/jake-f/week-4.path.llm.md)
