You are going to learn how to use git and Github by creating a new repo on GitHub and cloning it to your device. You will be able to push to it as well.
- Follow the instructions from Github for how to generate and connect an SSH key
- This key will allow you to communicate with github from your terminal without having to log in over and over again
- Let your instructor or TA know when you’ve successfully tested your SSH connection.
- Login to your account on GitHub
- Click on the green
Newbutton. (🎁 Gift: github.new is a shortcut website that allows you to quickly create a new repo) - Name it
HelloGithub - Make sure you select
public - Create the repo
You own this repo because you created it! It's time to clone it!
-
Click on the green
codebutton -
Select SSH and copy the ssh link. Should look like this:
-
Open the terminal app
-
Navigate to the folder you created that includes your development work
-
Clone the repo from the copied url
$ git clone git@github.com:{YOUR_ACCOUNT_NAME}/HelloGithub.git⚠️ If you get an error, check step 0 again -
The repo should be cloned now on your device. Go to the cloned repo by writing the command
$ cd HelloGithub
- Create a new text file in this directory with your name. (e.g. "zainab.txt")
addandcommitthe empty text file you just made.- Open the text file, write something about yourself, and save the file.
addandcommitthe text file again.pushyour local changes to the remote repository.- Add an image of your favorite food in your local repository. (You can download any image for this from Google if you need to.)
add,commit,pushyour changes.
