Goal: Now that you know how to clone repositories and how to write README.md files, let's practice by adding README.md files written in Markdown to the repositories you created yesterday. Working as a pair, you will add a README.md to one of each student's previous projects.
It’s important that we clone our existing repositories rather than just downloading the files. By using
git clone we maintain the link to the git repository and can continue to make commits to the same project.
Note: If you are a remote student, you probably have the work you did yesterday still on your computer. Either put those directories in the trash (or in another directory other than the desktop if you're concerned that you didn't properly push your code to GitHub). Then go through the process of cloning your work down again.
Let's start with this:
git cloneto clone the my-first-webpage repository from your GitHub.
lsin the Terminal and you should see your project folder appear.
git logto confirm that you are in the project folder and can see all of your git commits from your previous work on this project. (If this list of commits is long, you may have to press
qto get back to the command line prompt.)
git remote -vand you should see a remote link nicknamed
originto your remote repository url. (Whenever we clone a project from GitHub the repository we cloned from is automatically included as a remote named origin).
After you finish updating your my-first-webpage project, the owner of the project you're currently working on will commit the new README.md file and push the updated project back up to their GitHub using the following instructions:
$ git add .(the "
." allows you to add all files without needing to add each individually by name)
$ git commit -m "Add README"
$ git statusto ensure that everything has been committed
$ git push origin masterto push your updated project back up to GitHub
Now that you've added a README.md to your my-first-webpage project, give the keyboard to your partner to allow your pair to do the same for one of their projects. Repeat the directions above.
Lesson 20 of 55
Last updated October 12, 2020