From the course: Working with LinkedIn Learning Exercise Files on GitHub

Clone the repository to your local computer - GitHub Tutorial

From the course: Working with LinkedIn Learning Exercise Files on GitHub

Clone the repository to your local computer

- [Instructor] Let's talk a minute about the repository I'll be using for this chapter. And I picked one of our existing repositories. It's from a course I did a few months ago. Actually, I did this last year. And this is my Visual Studio Advanced Debugging course. So we typically name LinkedIn Learning names or repositories based on the name of the course. In this case, you can see it's vs-adv-debug, and then we put the course number on the end. So you go here, you find this, you can click on here to grab the URL so you can clone it. And I picked this existing course because it's already got a lot o' code in it, and it has a number of branches in it. I have the master branch here, and then I also have these numbered branches, so these represent chapter two, video one, chapter two, video five, and so on. So these allow us to experiment with branches in this chapter. Remember in this chapter, we're looking at how to work from the command line. So my tool of choice for today is the Windows terminal. This is the new terminal that's part of Windows 10, or it's addition you can add to Windows 10. It will be added to the operating system in some future date. If you're a Windows developer or a Windows IT pro, you can also use PowerShell or the command line. If you're working in another operating system, pick the shell of your choice or the terminal of your choice there. So let's switch over to Windows terminal. I really like the new Windows terminal. Currently, what I'm recording, it's an additional install on Windows 10, but it will be included in the operating system real soon. And one of its benefits is it supports multiple tabs, so you can see I've got two tabs open here with different paths open here. And I can also have different shells. Right now I've got it set up for Windows PowerShell and Azure Cloud Shell and Command Prompt. And to open one of those, I just click on this dropdown and choose, in this case let's choose Command Prompt. You see it switches to a different command line. So I'll be working in PowerShell, and there's a couple things you might notice when I open up this PowerShell window, is it's got a custom image in the back, so I've done some customization, and it's also got a custom prompt. And as we start going down into the Repos folder, you'll see that change and show me some information about my repo. If you would like to customize your prompt to look similar, you need to follow some instructions on the internet. I return back to the Windows terminal, and I would need to move to my repository folder. You need to move to the location that makes sense for your computer. I'll go to my source folder, and then I'll go to the Repos folder, and then I'll dir here to show you what's in this folder. I've got a number of existing repositories from some of my prior courses, and I want to add the one from my Advanced Debugging course. So what I do is I invoke git, then I call clone, and then I paste in this URL and hit Enter. You can see it's cloning into this folder named vs-adv-debug and that course number. That's the same name we saw on the GitHub website. Clear the screen and then show you what's in that folder, and now you see that I have this new folder that contains the content. We'll verify it contains the content, so I'll do a change directory, go to vs. And here's where you start seeing the customization of my prompt. You notice in the white text, it says git, and then it says master, and this is showing me that I'm on the master branch in this repository. Now, I'll do a dir in this folder, and you can see the root folder, it has my README files in there, and there's where you find the git databases in here. There's your gitignore file. And then in my case, there is a folder called Source which contains the solution and files. So I'll open this up by doing a cd source. You'll see there's only two files in here. This is a Visual Studio course, so it typically has an sln file, and then it has these text files Where-Is-The-Sample-Code.txt. There's only two files in here. Now, as you start going through the course and you start switching branches, you'll see the contents of this folder change, but there's only these two files when you first start on the master branch. At this point, we've cloned a repository to the local hard drive, and now we're ready to switch branches.

Contents