From the course: Java's Toughest Bugs
Using GitHub Codespaces with this course - Java Tutorial
From the course: Java's Toughest Bugs
Using GitHub Codespaces with this course
- [Instructor] Before jumping into the course, there's a few logistics we should talk about. We'll be using GitHub for the exercise files that'll go along with each video. For all chapters except chapter four, the code is located on the main branch. To access the code for a given video, you'll go to the appropriate chapter folder and then the appropriate video folder. For example, the code for chapter three video one will be in the chapter three folder, and then 0301. From here, we have two folders that have the beginning and end state code from the video. 03_01B has the beginning state, and 03_01E has the end state. Now this is the case for all the code except chapter four. Chapter four is slightly different because it uses dependencies in Maven, so we've put the code on different branches to avoid conflicts between files. This means the beginning code for the second video in chapter four will be on branch 04_02B. Here it is. Now the end code for this video will on branch 04_02E. We'll click the branch and switch it to the end state. This is the end state code for the second video in chapter four. By clicking into these different branches and into different folders, I can view the code online, and this is great, but we can do better. If you want to actually work with the code and run it, you have a few options. One option is to go to the branch with the code you want and download the zip file. To do that, we go to Code, Local, Download ZIP. Then you'd have to download the dependencies to run this code. This includes the right version of Java and Maven. With this method, you'll download the code of the current branch you're on, and you can run it locally on your computer. Now, this is the old way of doing things. Recently, a new way was introduced with GitHub Codespaces. GitHub Codespaces is a cloud-powered environment built into GitHub that makes it easier for us to write code and not worry too much about the setup. To set this code up in a GitHub Codespace, I'll fork it over to my own account and create my own version of it. Let's fork it. We'll call our new repo Javas-toughest-bugs, and we'll fork all the branches so we get the content from chapter four too. Let's create the fork. To open up a Codespace, I'll click the Code button, Codespaces and create a code space on the main branch. To create a Codespace on a different branch, all you do is go to that branch and follow the same steps we've done here. You'll select your branch, go to Code, and create the Codespace. Within our Codespace, there's already a few things set up for you. One is Java. It's already installed and ready to go. Now this is running the code from our main branch. If we ever want to make a change and commit it, we can do that right here in this virtual IDE. It'll commit it to your forked repo so you can save your changes as you code along with this course. Let's make a small change to the Read Me. We'll add, this is the forked repository for the course. To commit the change, we'll go to source control and add a commit message. Modify Read me. We'll commit the change, stage it and push it up to GitHub. Going back to GitHub, if we refresh the page, we can see our commit. Our changes from the Codespace were saved to GitHub. With that out of the way, let's jump into our bugs.