Link Search Menu Expand Document

codesapce for CS50(Use Github credential)

Link: https://code.cs50.io/

image

The codespsce for cs50 is an online IDE. We will use for class activities.

How to login


Important Note on code.cs50.io

Since code.cs50.io for Harvard CS50, it is connected to cs50 repo.

To escape from cs50 repo, type these codes on the terminal.

cd ~
code .

It will open a new window and we will use it. Close the previous codepace window.

We also need to configure git via ssh.


Configure Git to use SSH in your CS50 Codespace

On your codespace terminal in code.cs50.io,

  1. Execute ssh-keygen. Enter twice.

image

  1. Execute cat ~/.ssh/id_rsa.pub. Highlight and copy all of those lines, from ssh-rsa to the end. It is your public key.

image

  1. Visit https://github.com/settings/keys with your Github ID and password. Click New SSH Key.

image

    • Type CS100 under Title.
    • Paste your public key into the text box under Key.
    • Click Add SSH key.

image

  1. You may need to type your Github password.

Weekly class activities

You will submit your weekly class activities using Github.

  1. Every week I will send an invitation link into your QCC email. Please, check and go to the link with your Chrome or Edge browser.

Safari may not work properly.

  1. Accept my invitation from my email.

image

  1. Reload your browser(ctrl+r or cmd+r).

image

  1. Now click the link in the middle.

image

  1. Click the Code button. Choose SSH and click the icon( ) to copy the link. (You can copy the link by yourself.)

image

  1. On the terminal of your codespace, go to ~ by typing cd ~. Then type git clone and paste with the link copied.

For example, if your link is [email protected]:22S-CS100-CNW1/day1-qccjohndoe01.git, then type

cd ~
git clone [email protected]:22S-CS100-CNW1/day1-qccjohndoe01.git
  1. The terminal may ask a question regarding a authenticity. Type yes and Enter.
    Cloning into 'day1-qccjohndoe01'...
    The authenticity of host 'github.com (140.82.113.3)' can't be established.
    ECDSA key fingerprint is SHA256:p2QAMXNIC1TJYWeIOttrVc98/R1BUFWu3/LiyKgUfQM.
    Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
    Warning: Permanently added 'github.com,140.82.113.3' (ECDSA) to the list of known hosts.
    
  2. Go to the folder created. From the above link [email protected]:22S-CS100-CNW1/day1-qccjohndoe01.git, the name of the folder is day1-qccjohndoe01.
    cd day1-qccjohndoe01
    
  3. To read README.md, type
    code README.md
    
  4. To view README.md, click the icon ( ) on the right top corner.

image


How to submit weekly class activities (Terminal)

  1. Go to the folder of today’s weekly class activity. For example, let’s assume it is day1-qccjohndoe01.
    cd ~
    cd day1-qccjohndoe01
    
  2. Add files into local git.
    git add .
    
  3. Commit it into local git.
    git commit -m "012922"
    

    You can replace “012922” with any string with quotation marks.

  4. Push it to Github server.
    git push
    

How to submit weekly class activities (GUI)

  1. On the right sidebar, click the icon ().

  2. Click 3 dot icon and select Source Control

image

  1. Below Source Control, type 012922. You can replace 012922 with any string.

image

  1. codespace will sync with few seconds automatically.

Copyright © 2022 Kwang Hyun Kim