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 4: Personalize your codespace!

Nicely done customizing your codespace! 🥳

When using any development environment, customizing the settings and tools to your preferences and workflows is an important step. GitHub Codespaces offers two main ways of personalizing your codespace: Settings Sync with VS Code and dotfiles.

Dotfiles will be the focus of this activity.

What are dotfiles? Dotfiles are files and folders on Unix-like systems starting with . that control the configuration of applications and shells on your system. You can store and manage your dotfiles in a repository on GitHub.

Let's see how this works!

⌨️ Activity: Enable a dotfile for your codespace

  1. Start from the landing page of your repository.
  2. In the upper-right corner of any page, click your profile photo, and then click Settings.
  3. In the Code, planning, and automation section of the sidebar, click Codespaces.
  4. Under Dotfiles, select Automatically install dotfiles so that GitHub Codespaces automatically installs your dotfiles into every new codespace you create.
  5. Click Select repository and then choose your current skills working repository as the repository from which to install dotfiles.

⌨️ Activity: Add a dotfile to your repository and run your codespace

  1. Start from the landing page of your repository.

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

  3. Click the Codespaces tab on the box that pops up.

  4. Click the Create codespace on main button.

    Wait about 2 minutes for the codespace to spin itself up.

  5. 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

  6. From inside the codespace in the VS Code explorer window, create a new file setup.sh.

  7. Add the following code inside of the file:

    #!/bin/bash
    
    sudo apt-get update
    sudo apt-get install sl
  8. Save the file.

    Note: The file should autosave.

  9. Commit the file changes. From the VS Code terminal enter:

    git add setup.sh --chmod=+x
    git commit -m "Adding setup.sh from the codespace!"
  10. Push the changes back to your repository. From the VS Code terminal, enter:

    git push
  11. Switch back to the homepage of your repository and view the setup.sh to verify the new code was pushed to your repository.

  12. Close the codespace web browser tab.

  13. Click the Create codespace on main button.

    Wait about 2 minutes for the codespace to spin itself up.

  14. Verify your codespace is running, as you did previously.

  15. Verify the setup.sh file is present in your VS Code editor.

  16. From the VS Code terminal, type or paste:

    /usr/games/sl
  17. Enjoy the show!

  18. 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

svein-olav 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.