First, let's define what "cloning" a repository means!
Essentially, we're copying the repository (as well as it's history, though how much can depend on what flags we use) to our local file-system!
-
Navigate to the public repository you wish to clone on GitHub.com
-
Since we've already set-up SSH, we'll want to collect the SSH address for the GitHub.com repository!
a. You can either use the provided screenshot to navigate to the SSH address and copy it: b. Or you can use the pattern:
[email protected]:<USERNAME>/<REPOSITORY NAME>.git
.c. As an example, this repository's SSH address is:
[email protected]:chris-alexiuk/GitGood-Cloning.git
-
Now that you have the SSH address for the repository, you can use the `git clone command in your terminal to clone the repository the SSH address points to, to your present working directory (PWD).
a. Your PWD is whatever directory your terminal says you're in! As an example, my PWD in this screenshot is
~/Projects/GitExamples
b. There are a number of additional flags you can use, and many other ways you can use the command. This documentation page has everything you need, and don't forget you can always
git help clone
!c. An example of a command might be:
git clone [email protected]:chris-alexiuk/GitGood-Cloning
-
Now you should have a local copy! This comes with some additional bonuses that I will discuss in a later video!