Coder Social home page Coder Social logo

skills-code-with-codespaces's Introduction

Code with GitHub Codespaces and Visual Studio Code

Develop code using GitHub Codespaces and Visual Studio Code!

Step 1: Create your first codespace and push code

Welcome to "Develop code using GitHub Codespaces and Visual Studio Code"! 👋

What's the big deal about using a codespace for software development? A codespace is a development environment that's hosted in the cloud. You can customize your project for GitHub Codespaces by committing configuration files to your repository (also known as configuration-as-code), which creates a repeatable codespace configuration for all users of your project. Each codespace you create is hosted by GitHub in a Docker container that runs on a virtual machine. You can choose the type of machine you want to use depending on the resources you need.

GitHub offers a range of features to help your development team customize a codespace to reach peak configuration and performance needs. For example, you can:

  • Create a codespace from your repository.
  • Push code from the codespace to your repository.
  • Use VS Code to develop code.
  • Customize the codespace with custom images.
  • Manage the codespace.

To begin developing using GitHub Codespaces, you can create a codespace from a template or from any branch or commit in a repository. When you create a codespace from a template, you can start from a blank template or choose a template suitable for the work you're doing.

⌨️ Activity: Start a codespace

We recommend opening another browser tab to work through the following activities so you can keep these instructions open for reference.

  1. Start from the landing page of your repository.

  2. Click the green Code button located in the middle of the page.

  3. Select the Codespaces tab in the box that pops up and then click the Create codespace on main button.

    Wait about 2 minutes for the codespace to spin itself up. Note: It's a virtual machine spinning up in the background.

  4. Verify your codespace is running. The browser should contain a VS Code web-based editor and a terminal should be present such as the below: codespace1

⌨️ Activity: Push code to your repository from the codespace

  1. From inside the codespace in the VS Code explorer window, select the index.html file.

  2. Replace the h1 header with the below:

    <h1>Hello from the codespace!</h1>
  3. Save the file.

    Note: The file should autosave.

  4. Use the VS Code terminal to commit the file change by entering the following commit message:

    git commit -a -m "Adding hello from the codespace!"
  5. Push the changes back to your repository. From the VS Code terminal, enter:

    git push
  6. Your code has been pushed to your repository!

  7. Switch back to the homepage of your repository and view the index.html to verify the new code was pushed to your repository.

  8. Wait about 20 seconds then refresh this page (the one you're following instructions from). GitHub Actions will automatically update to the next step.


Get help: Post in our discussion boardReview the GitHub status page

© 2023 GitHub • Code of ConductMIT License

skills-code-with-codespaces's People

Contributors

xprocessing avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.