GH-CODESPACE-REBUILD(1)

πŸ’… GH-CODESPACE-REBUILD β€” bestie's guide to the rebuild button but make it terminal

okay so you're in the gh manual, specifically the gh-codespace-rebuild page, part of the GitHub CLI manual. yes this is the one that rebuilds your codespace. no we are not panicking. let's go πŸŽ€


✨ NAME ✨

gh-codespace-rebuild β€” rebuild a codespace, fr fr it literally rebuilds it πŸ¦‹


✨ SYNOPSIS ✨

gh codespace rebuild [flags]

that's it. that's the whole vibe. flags go after, periodt πŸ’…


✨ DESCRIPTION ✨

so rebuilding means your codespace gets recreated from scratch β€” like a glow-up but for your container ✨

the important part, and do not skip this: your code and any current changes will be preserved 🫢 ngl that's the whole reason this command is safe to run. your codespace gets rebuilt using your working directory's dev container, so it matches whatever config you're actually sitting in.

also, a full rebuild (that's the --full flag, more on her below) also removes cached Docker images. yes, all of them. it's giving "clean slate main character energy" 😭


✨ OPTIONS ✨

  • -c, --codespace <string> β€” the name of the codespace. tell her which one you mean πŸ’–
  • --full β€” perform a full rebuild πŸ”₯ (and remember from up there: full rebuild = cached Docker images get yeeted too)
  • -R, --repo <string> β€” filter codespace selection by repository name, formatted user/repo πŸ“
  • --repo-owner <string> β€” filter codespace selection by repository owner β€” that's a username or an org, so you can narrow it down before you pick 🌸

✨ EXIT CODES ✨

like, she'll tell you exactly how it went:

  • 0 β€” successful execution πŸ‘‘ slay
  • 1 β€” error πŸ’€
  • 2 β€” command canceled πŸ™ˆ (you hit the brakes)
  • 4 β€” authentication required πŸ” go log in bestie
NOTE: specific commands may have additional exit codes. refer to the command's help for more information. iykyk, always check the help 🌈

✨ SEE ALSO ✨


and that's the page!! you understood the assignment πŸ’œ this was written for GitHub CLI v2.102.0, dated Oct 2026 β€” so if you're reading this in some other timeline, check your version, ok bye love u 🫢⭐

πŸ“¦ where this page comes from