- To “clone” a repository means to make a local copy of a repository from a remote copy of it.
- you can clone any public repository on GitHub, from any user account or organization
- In-class activity 1: Clone the GitHub repository markdown-cheatsheet to your computer using termnal commands:
- Go to the repository home on GitHub, at https://github.com/LunaSare/markdown-cheatsheet
- Copy the ssh address of the repo. You can find that by clicking on the green button that says “Code”:
- Go to your terminal and change directories (
cd
) to where you want to save the copy of the repo locally (aka in your computer). Note: Do not clone a repo inside another repository (e.g., your class repository). This creates problems. If you accidentally cloned the markdown-cheatsheet repo inside another repo in your computer, delete the markdown-cheatsheet repo with the command:rm -rf markdown-cheatsheet
- To create a local copy of the repo, use the command
git clone "paste here the ssh address that you copied from the repo on GitHub"
. - What happened on the terminal?
- List the contents of your current directory. Do you see a new folder there?
- Change directories to the new folder and list its contents. Compare this local list of files to the contents of the repo on Github. What do you note?