We will be using some terminal commands, so let's make sure you know what they are and what they do!
Command | Stands For | Description |
---|---|---|
ls |
long listing | lists all files and directories in the present working directory |
ls -a |
long listing all | lists hidden files as well |
cd {dirname} |
change directory | to change to a particular directory |
cd ~ |
change directory home | navigate to HOME directory |
cd .. |
change directory up | move one level up |
cat {filename} |
concatenate | displays the file content |
sudo |
superuser | allows regular users to run programs with the security privileges of the superuser or root |
mv {filename} {newfilename} |
move | renames the file to new filename |
clear |
clear | clears the terminal screen |
mkdir {dirname} |
make directory | create new directory in present working directory or at specified path |
rm {filename} |
remove | remove file with given filename |
touch {filename}.{ext} |
touch | create new empty file |
rmdir {dirname} |
remove directory | deletes a directory |
ssh {username}@{ip-address} or {hostname} |
secure shell | login into a remote Linux machine using SSH |
Generating a GitHub Access Token
Create an account with GitHub here if you do not have one.
Navigate to GitHub's Developer Token settings.
Click on Generate new token
> Generate new token (classic)
Give the token a description, set the expiration (we recommend 90 days), and check every box. When you're done, click Generate token
at the bottom of the page.
Copy the access token and save it for later use. We will use this token to interact with GitHub. Please do not lose this access token or you will need to generate a new one.
Github SSH Setup
Secure Shell Protocol (SSH) provides a secure communication channel of an unsecured network. Let's set it up!- Generate a Private/Public SSH Key Pair.
ssh-keygen -o -t rsa -C "your email address for github"
-
Save file pair. Default location
~/.ssh/id_rsa
is fine! -
At the prompt, type in a secure passphrase.
-
Copy the contents of the public key that we will share with GitHub.
-
Mac:
pbcopy < ~/.ssh/id_rsa.pub
-
Windows (WSL):
clip.exe < ~/.ssh/id_rsa.pub
-
Linux:
xclip -sel c < ~/.ssh/id_rsa.pub
-
-
Go to your GitHub account and go to
Settings
. -
Under
Access
, click on theSSH and GPG keys
tab on the left.
- Click on the
New SSH Key
button.
- Name the key, and paste the public key that you copied. Click the
Add SSH Key
button
Creating a New Repository
When viewing the respository page, click on New
and proceed to create your repo.
Filling Respository Details
Create the repository by inputting the following:
Repo name
Repo description
- Make repo
public
- Add a
README
- Add
.gitignore
(Python template) - Add
license
(choose MIT)
Then click Create Repository
.
Clone Your Repo
- Open your terminal and navigate to a place where you would like to make a directory to hold all your files for this class using the command
cd
.
cd {directory name}
- Once there, make a top level directory using
mkdir
.
mkdir {directory name}
cd
into it and make another directory calledcode
.
cd {directory name}
mkdir code
cd
into it and run yourgit clone {your repo url}
command.
cd code
git clone {your repo url}