Join Walt Ritscher for an in-depth discussion in this video Use Checkout to open exercise files from Git branches, part of Create Universal Windows Apps for Xbox One: Enhance Your First App.
- [Instructor] Here, on the GitHub website, you'll see that the project is organized into branches. You can see them by going to the GitHub repo site and clicking on this drop-down. Each branch corresponds to a video from this course. They're named according to the chapter and video they correspond to. For example, this one 02_04 is for chapter two, video number four. Use each of these branches to load the projects and files necessary for the example. When I include a finished version of the exercises, you'll see a file name like this, 02_02_Done.
That same list of branches is available in Visual Studio. I have opened the solution in Visual Studio. It's called Xbox Essentials and there's a single project underneath that called Art Center 2. This will be the project you'll be working in throughout the course. When you first clone a repo, you'll be on the master branch. Remember that all of our sample codes in individual branches. So, the first thing we want to do is go ahead and find those branches. So, go to Team Explorer and then click on Branches. And what you'll see is, at the top, is the local checkout branches and on the bottom are the ones that are considered to be remote, the ones that we got from GitHub.
So, let's say you want to open this one. Currently we're on the Master. You can see that's in bold. So, I can right click on this and choose Checkout, or I can double click. Now, notice what happened. When I checked it out, it shows up on the top half. These tool tips keep popping up, get out of the way there. It says 01_01 and it's in bold. That means that's the checked out branch. Now we'll go and open branch 02_04. Another way I can open it is just to double click on it in the Remote section. You see that it appears at the top.
So, what you're seeing is, as you check them out from the Remote, they show up in this top half, and that means instead of having to go to the remote layer when I want to switch back and forth between these two, I can just click here, right here. Before I do that, let's pull Team Explorer out, put it next to Solution Explorer like that, so we can see the changes that are happening. Now I'll double click on 01_01. That loads that branch in and you can see the files change inside the Solution Explorer and then when I double click on 02_04, it loads all the files that are affiliated with that branch.
Let me check out a couple more. I'll check out 03_01 and I'll check out 05_01. And then I'll show you another way of getting to these, one that I use a lot more often than using this Team Explorer window. So, I'll double click on this title bar while holding down the Control key. That'll put it back here. Then, if you look on the bottom right, you'll see, on this toolbar, it shows that I'm currently in the Xbox02 Repo and then over here is a quick access.
It shows me all of the local items that I've already checked out. So, the four items that I've checked out are listed here, so I can quickly switch back and forth between them by just clicking here. I don't have to go to the Team Explorer and drill down and find the branches. Just go here, choose the one I want, you quickly switch. If you don't see a branch that you want there, all you need to do is open this up, choose Manage Branches, and then open the one that you did want. Let's say we choose 04_02, double click on that, and then when you go back down here, you'll see it's now available as a local branch.
One more thing before I go is every time you open a branch, you want to make sure that you build the project. That way, your (unintelligible) IntelliSense will work all your packages will be loaded, and you'll have a better experience than if you just start coding. I'll go up here and do Build, Build Solution. Got a success message on the bottom of the screen, so that means we're ready to start building our app.
- Configuring the deploy and debug settings
- Understanding the controllers
- Using the KeyUp event with controller buttons
- Understanding XY focus navigation
- Choosing a good initial focus
- Understanding Xbox UI scaling
- Working with sounds