Python for Entrepreneurs Transcripts
Chapter: Source Control and Git
Lecture: Cloning repos in Git
0:01 Our GitHub account is configured and we've created a repository now we want to clone that repository onto our local system
0:08 using the SSH keys that we've built throughout this chapter. Switch over to GitHub to the example project that we just created,
0:15 we're going to clone this repository onto our local system. Now typically what we want to do is click the clone or download button, and copy this URL.
0:24 But we don't have access just yet, we need to do one step on the command line, before we can make this happen.
0:31 Go to the command line, where you have our public and private key; so again, entrepreneurs is the private key and entrepreneurs.pub is the public key.
0:37 We've already uploaded the public entrepreneurs key, we want to copy the private key into our .ssh directory under our home directory
0:45 in order to make this active. So type "cp entrepreneurs ~/" and put that in your home, tilde is for home, and then .ssh.
0:55 Now if you don't have a .ssh directory, just create that directory. With our private key and a .ssh directory, now we can clone the Git repository,
1:03 change into the directory where you want to clone the repository, and run the "git clone" command.
1:08 Now we've already copied the URL that we want for the repository so we could just paste that in.
1:14 And now if we press Enter, we're going to get cloning my project and the repository is there. So now we can see all the files that we have
1:21 and in fact even the .gitignore file and the .gitdirectory are in there as well.
1:26 We've got our Git project history so we can type "git log", all the Git commands that we are going to learn even more about in the next chapter.
1:32 Let's clone one more repository, so move back into maybe your home directory or wherever you are keeping your projects,
1:39 switch back over to your GitHub, take a look at the Git repository
1:43 "Python-for-entrepreneurs-course-demos" that is under Michael Kennedy's GitHub account.
1:48 This repository contains all the code and the example materials for this course. And we want to capture all of this onto our local system.
1:56 So just like we did with our example repository, click clone or download and copy and paste this URL.
2:02 Move back over to the command line, and then type "git clone" and paste in that URL. It may take a few minutes, this is a larger repository,
2:12 but now we have everything we need, on our local system. We can use any of the Git commands that we want, like "git log" to see what's changed,
2:19 we can even "git pull" for all of the files that might be new, so that's how we clone Git repositories off of GitHub.
2:26 In the next chapter, we're going to take a look at all the Git commands and get intimately familiar with how each of them work.