From the course: Visual Studio Developer Tips

Use Checkout to open exercise files from Git branches - Visual Studio Tutorial

From the course: Visual Studio Developer Tips

Use Checkout to open exercise files from Git branches

- [Instructor] Here on the GitHub website you'll see that the project is organized into branches. Each branch corresponds to a tip from this course. They're named according to the video they correspond to. Tip001 is for the first tip, Tip002 is for the second. Use each branch to load the projects and files necessary for the example. When I include a finished version of the exercise like you see here, the branch name will end with -Done. The same list of branches is available in Visual Studio. Here's where you can find them and use them to check out your copy of the tip. Open your solution, then go to Team Explorer. For this demonstration I'll make the Team Explorer a floating window. That way I can see the branches in the Team Explorer and I can see the results of checking out a branch in the Solution Explorer. Now click on the Branches section of Team Explorer. What you'll see when you first open a project, it usually opens to the master branch, and that's what I'm seeing here. I've got the master branch open and all the other branches are available in this section under remote/origin. There's the same branches that we saw on the GitHub website. To check out tip number one right click and choose Checkout. And you notice there was some action happening over here in the Solution Explorer. It was configuring Solution Explorer in the projects to match tip number one. Now you'll also notice that a copy of tip number one moved up in here into the local area, so you can check it out from here. This gets a bit confusing. Now let me show what I mean. I'll check out tip number two. In this case tip number one and tip number two use exactly the same projects and solutions, so you don't see any changes over here. But I want you to see that if I go back to tip number and right click, Checkout is grayed out. That's because I've got it here in the local area now. If I want to check it out again and I've already checked it out at least one time it'll be up here. So now you want to right click up here to check it out. One thing to note is some of my tips use the same set of project files, so you might not notice any changes, but I've put in individual tip numbers so it makes it easy. You know you're watching video number five, you can come down here and choose Checkout. Now I'll show you what's happening in some of these files. Look at these JSON files, XML files. Now I'll go back to tip number one, check that out, and then reopen that console application. You'll see they're gone. So it's removing the folders that you don't need for tip number one and adding them back when you open tip number five. You'll also notice that, I'll go down here to tip number eight and check out tip eight. In this example it removed two of the projects. Now it's down to the console app, the CourseLib app, and the WPF app. So as you go through the tips over the next year you'll start to see different changes based on which tip you check out. Put this window back in its previous location, hold down the Control key and double click on the title bar. That's one of the tips you'll learn later in the course.

Contents