1
0
mirror of synced 2025-12-21 10:57:10 -05:00
Files
docs/content/codespaces/getting-started/quickstart.md
Amy Burns d68f6c1791 Adding more developer focused content for Codespaces docs (#19823)
* updating arch for new developer focused content

* remove about codespaces from child list

* Devcontainer updates

* rearranging for new getting started content

* reorganizing and renaming getting started

* Add VS to tool switcher

* Actually adding correct key for vscode

* Adding vscode as a switcher value

* Adding switcher to quickstart

* Updates to quickstart

* adding first draft of creating your codespace

* taking out additional line and linking to customizing your codespace docs

* Update new codespace img

* Updating devcontainer.json for docs

* fixing changes and adding more ideas for deep dive

* adding a few more changes to the deep dive

* suggestings from jake and expanding the deep dive

* re-writing some content

* adding information about a shallow clone

* add more information about dev containers

* adding feedback

* Apply suggestions from code review

Co-authored-by: Felicity Chapman <felicitymay@github.com>

* adding a note box to committing section

* adding correct link for default container

* improving deep dive based on feedback

* making some edits, adding diagrams and images, and making it seem less like a wall of text

* addinig new image

* updating port forwarding diagram

* removing duplicated redirects

* updating overview with feedback from Matt and a more active voice

* updating quickstart based on feedback

* updating deep dive based on feedback

* remove updates for switcher

* Clarify that dotfiles are opt-in

Per https://github.com/github/codespaces/issues/3223

* fixing header size

* moving codespace higher up the list

* updating based on feedback from Martin and Meg

Co-authored-by: Allison Weins <3174849+2percentsilk@users.noreply.github.com>
Co-authored-by: Felicity Chapman <felicitymay@github.com>
Co-authored-by: Jake Shorty <jshorty@github.com>
Co-authored-by: James M. Greene <JamesMGreene@github.com>
2021-07-19 17:10:18 +00:00

6.5 KiB

title, intro, allowTitleToDifferFromFilename, versions, type, topics, redirect_from
title intro allowTitleToDifferFromFilename versions type topics redirect_from
Quickstart for Codespaces Try out {% data variables.product.prodname_codespaces %} in 5 minutes. true
free-pro-team
*
quick_start
Codespaces
/codespaces/codespaces-quickstart

{% data reusables.codespaces.release-stage %}

Introduction

In this guide, you'll create a codespace from a template repository and explore some of the essential features available to you within the codespace.

From this quickstart, you will learn how to create a codespace, connect to a forwarded port to view your running application, use version control in a codespace, and personalize your setup with extensions.

For more information on exactly how {% data variables.product.prodname_codespaces %} works, see the companion guide "Deep dive into {% data variables.product.prodname_codespaces %}."

Creating your codespace

  1. Navigate to the template repository and select Use this template.

  2. Name your repository, select your preferred privacy setting, and click Create repository from this template.

  3. Navigate to the main page of the newly created repository. Under the repository name, use the {% octicon "download" aria-label="The download icon" %} Code drop-down menu, and select Open with Codespaces.

Open with Codespaces button

  1. To create a codespace, click {% octicon "plus" aria-label="The plus icon" %} New codespace.

New codespace button

Running the application

Once your codespace is created, your repository will be automatically cloned into it. Now you can run the application and launch it in a browser.

  1. Since this example uses a Node.js project, start the application by entering npm run dev in the terminal. This command executes the dev script in the package.json file and starts up the web application defined in the sample repository.

    npm run dev in terminal

    If you're following along with a different application type, enter the corresponding start command for that project.

  2. When your application starts, the codespace recognizes the port the application is running on and displays a prompt to forward that port so you can connect to it.

Port forwarding toast

  1. Click Open in Browser to view your running application in a new tab.

Edit the application and view changes

  1. Switch back to your codespace and open the haikus.json file by double-clicking it in the File Explorer.

  2. Edit the text field of the first haiku to personalize the application with your own haiku.

  3. Go back to the running application tab in your browser and refresh to see your changes.

{% octicon "light-bulb" aria-label="The lightbulb icon" %} If you've closed the tab, open the Ports panel and click the Open in browser icon for the running port. Port Forwarding Panel

Committing and pushing your changes

Now that you've made a few changes, you can use the integrated terminal or the source view to commit and push the changes back to the remote.

{% data reusables.codespaces.source-control-display-dark %}

  1. To stage your changes, click + next to the file you've changed, or next to Changes if you've changed multiple files and you want to stage them all. Source control side bar with staging button highlighted
  2. Type a commit message describing the change you've made. Source control side bar with a commit message
  3. To commit your staged changes, click the check mark at the top the source control side bar. Click the check mark icon
    You can push the changes you've made. This applies those changes to the upstream branch on the remote repository. You might want to do this if you're not yet ready to create a pull request, or if you prefer to create a pull request on {% data variables.product.prodname_dotcom %}.
  4. At the top of the side bar, click the ellipsis (...). Ellipsis button for View and More Actions
  5. In the drop-down menu, click Push.

Personalizing with an extension

Within a codespace, you have access to the Visual Studio Code Marketplace. For this example, you'll install an extension that alters the theme, but you can install any extension that is useful for your workflow.

  1. In the left sidebar, click the Extensions icon.

  2. In the search bar, enter fairyfloss and install the fairyfloss extension.

Add an extension

  1. Select the fairyfloss theme by selecting it from the list.

Select the fairyfloss theme

  1. Changes you make to your editor setup in the current codespace, such as theme and keyboard bindings, are synced automatically via Settings Sync to any other codespaces you open and any instances of Visual Studio Code that are signed into your GitHub account.

Next Steps

You've successfully created, personalized, and run your first application within a codespace but there's so much more to explore! Here are some helpful resources for taking your next steps with {% data variables.product.prodname_codespaces %}.