codesapce for CS50(Use Github
credential)
Link: https://code.cs50.io/
The codespsce for cs50 is an online IDE. We will use for class activities.
How to login
- Login to https://code.cs50.io/ .
- Use your
Github
ID (or QCC email) andGithub
password.
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
,
- Execute
ssh-keygen
. Enter twice.
- Execute
cat ~/.ssh/id_rsa.pub
. Highlight and copy all of those lines, fromssh-rsa
to the end. It is yourpublic key
.
- Visit https://github.com/settings/keys with your
Github
ID and password. ClickNew SSH Key
.
- Type
CS100
underTitle
. - Paste your
public key
into the text box underKey
. - Click
Add SSH key
.
- Type
- You may need to type your
Github
password.
Weekly class activities
You will submit your weekly class activities using Github
.
- Every week I will send an invitation link into
your QCC email
. Please, check and go to the link with yourChrome
orEdge
browser.
Safari
may not work properly.
- Accept my
invitation
from my email.
- Reload your browser(
ctrl+r
orcmd+r
).
- Now
click
the link in the middle.
- Click the
Code
button. ChooseSSH
and click the icon() to copy the link. (You can copy the link by yourself.)
- On the terminal of your codespace, go to
~
by typingcd ~
. Then typegit 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
- The terminal may ask a question regarding a authenticity. Type
yes
andEnter
.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.
- Go to the folder created. From the above link
[email protected]:22S-CS100-CNW1/
day1-qccjohndoe01.git
, the name of the folder isday1-qccjohndoe01
.cd day1-qccjohndoe01
- To read
README.md
, typecode README.md
- To view
README.md
, click the icon () on the right top corner.
How to submit weekly class activities (Terminal)
- Go to the folder of today’s weekly class activity. For example, let’s assume it is
day1-qccjohndoe01
.cd ~ cd day1-qccjohndoe01
- Add files into
local git
.git add .
- Commit it into
local git
.git commit -m "012922"
You can replace “012922” with any string with quotation marks.
- Push it to
Github
server.git push
How to submit weekly class activities (GUI)
On the right sidebar, click the icon (
).
Click
3 dot icon
and selectSource Control
- Below
Source Control
, type012922
. You can replace012922
with any string.
codespace
willsync
with few seconds automatically.