Skip to content

Latest commit

 

History

History
96 lines (62 loc) · 3.79 KB

File metadata and controls

96 lines (62 loc) · 3.79 KB

NOTE: You must be familiar with the basics of Git before you start.

Codespaces

Codespaces is a GitHub service that provides cloud-based development environments. With Codespaces, you can work on this project without any manual setup on your side.

Codespaces is a premium feature of GitHub, see the pricing calculator. GitHub offers 60 hours every month for free for a 2-core instance per user.

Create a new codespace

  1. Go to the main-website repository and fid the <> Code button in the upper-right corner.
  2. Click the <> Code button, a menu will pop up.
  3. Go to the Codespaces tab and click Create codespace on main.
  4. A new window with your codespace will open.

create

NOTE: Make sure to stop your Codespace instance once you're done working.__

Run the website server in a codespace

cs-start is a script in the root of the repository for starting the main-website server. The script configures hugo in a way that allows you to use preview features while working in a codespace.

  1. Run the script from your codespace terminal:

    ./cs-start
    

    start

  2. Go to PORTS and click the link to open a preview of the website.

    open

Contribute from a codespaces

We use topic branch workflow in all of our repositories.

Create a new branch

  • From the terminal:

    git switch -c <name-of-your-branch>
    
  • In GUI:

  1. Select and hold Ctrl+Shift+g or click Source control

  2. Click the ellipsis (...) -> Branch -> Create Branch

  3. Type the name of your branch.

    branch

Make the changes

You can now work on your changes as if in a regular IDE.

Codespaces are based on Microsoft Visual Studio Code, so many tips for VS Code are applicable to Codespaces.

See the Codespaces official documentation for a comprehensive overview of features such as Colaborative editing.

Commit and push your changes

  • From the terminal:
    git add <filename>
    git commit -m "My descriptive and useful commit message"
    git push origin <name-of-your-branch>
  • In the GUI:
    1. In the Activity Bar, click Source Control.
    2. Click + next to the files you have changed.
    3. Type a commit message that meaingfully decribes your change in the text box.
    4. Click in the Commit button
    5. Select Commit & Push from the dropdown menu.

Open a pull request

See the Opening a pull request in Codespaces.

Stop a codespace

  1. Open Codespaces.

  2. Click the ellipsis (...) next to your codespace.

  3. Click Stop codespace.

    kill

Useful Codespaces resources