Python for Entrepreneurs Transcripts
Chapter: Source Control and Git
Lecture: Cloning repos in Git

Login or purchase this course to watch this video and the rest of the course contents.
0:01 Our GitHub account is configured and we've created a repository
0:04 now we want to clone that repository onto our local system
0:07 using the SSH keys that we've built throughout this chapter.
0:11 Switch over to GitHub to the example project that we just created,
0:14 we're going to clone this repository onto our local system.
0:17 Now typically what we want to do is click the clone or download button, and copy this URL.
0:23 But we don't have access just yet, we need to do one step on the command line,
0:27 before we can make this happen.
0:30 Go to the command line, where you have our public and private key;
0:33 so again, entrepreneurs is the private key and entrepreneurs.pub is the public key.
0:36 We've already uploaded the public entrepreneurs key,
0:39 we want to copy the private key into our .ssh directory under our home directory
0:44 in order to make this active.
0:46 So type "cp entrepreneurs ~/" and put that in your home,
0:52 tilde is for home, and then .ssh.
0:54 Now if you don't have a .ssh directory, just create that directory.
0:57 With our private key and a .ssh directory, now we can clone the Git repository,
1:02 change into the directory where you want to clone the repository, and run the "git clone" command.
1:07 Now we've already copied the URL that we want for the repository
1:11 so we could just paste that in.
1:13 And now if we press Enter, we're going to get cloning my project
1:16 and the repository is there.
1:18 So now we can see all the files that we have
1:20 and in fact even the .gitignore file and the .gitdirectory are in there as well.
1:25 We've got our Git project history so we can type "git log", all the Git commands
1:29 that we are going to learn even more about in the next chapter.
1:31 Let's clone one more repository, so move back into maybe your home directory
1:35 or wherever you are keeping your projects,
1:38 switch back over to your GitHub, take a look at the Git repository
1:42 "python-for-entrepreneurs-course-demos" that is under Michael Kennedy's GitHub account.
1:47 This repository contains all the code and the example materials for this course.
1:52 And we want to capture all of this onto our local system.
1:55 So just like we did with our example repository, click clone or download
1:58 and copy and paste this URL.
2:01 Move back over to the command line, and then type "git clone" and paste in that URL.
2:08 It may take a few minutes, this is a larger repository,
2:11 but now we have everything we need, on our local system.
2:14 We can use any of the Git commands that we want, like "git log" to see what's changed,
2:18 we can even "git pull" for all of the files that might be new,
2:22 so that's how we clone Git repositories off of GitHub.
2:25 In the next chapter, we're going to take a look at all the Git commands
2:28 and get intimately familiar with how each of them work.