From the course: Training Neural Networks in Python

Using GitHub Codespaces with this course - Python Tutorial

From the course: Training Neural Networks in Python

Using GitHub Codespaces with this course

- [Instructor] This is Ravi De Lobos, Senior Staff Instructor at LinkedIn Learning, and I'm going to show you how to work with LinkedIn Learning courses using GitHub Codespaces. Codespaces is a code editor in the cloud with the full power of Visual Studio Code. It allows for real world hands on practice that mirrors software development in the workplace. This course was created using GitHub Codespaces. Using Codespaces, you have everything you need to get going without needing complex installations or build tools. One click and you're ready to go. To practice along with the course, you can create a codespace directly from the course overview page. First, click Open next to GitHub Codespaces. If you're already logged in, you'll be directed to a Getting started with GitHub Codespaces page. If you're not logged in, you'll be prompted to log in or create a free GitHub account first. From this page, click on Create codespace on main. The first time you open up a codespace, it might take a few minutes to create the virtual machine. Once it's done, you'll enter the code editor environment. If you're familiar with Visual Studio Code, this is a special version of that editor, running on GitHub's servers. Your course can have one or more extensions preinstalled based on the course you're taking. Those can be found in the extensions panel. Because this is a browser, it's easy to inadvertently close the browser window and lose the editor. If you do that, don't panic, Codespaces saves everything you're doing on a virtual machine. You can always get the codespace back for this repo right here. Notice that it even remembered that I had opened the extensions panel. An alternate way to create a codespace is directly from one of our course's GitHub repositories. From here, click Code and then Create codespace on main. You can also restart a previous codespace from this location. GitHub Codespaces is compatible on devices with smaller screen sizes like mobile phones or tablets, but it is optimized for larger screens, so we recommend that you practice along with this course on a laptop or desktop computer. The sample course I'm looking at is what is known as a flat branch repository. You can tell because there's a single branch when you click on the branch icon on the status bar. You can also tell because there are different folders for each of the videos in the course. This is a sample of what a multi-branch repository looks like, which is more common when you're working with web frameworks. If you go to the branch icon on the status bar, you can see that there's more than one branch. You can switch to the different branches using this menu. The branches are named with the chapter and the video number you're watching. If you see a b at the end of the branch, that's how the code looked at the beginning. If you see an e, that's how the code looked at the end. Let's switch to how the code looked on chapter two in the third video. I'll choose the beginning branch. As you work through a course, you might make some changes on a branch. I'm going to make a minor edit on the index.html file right here. I'm going to go ahead and save that, and you can see that I've modified this file because there's an M right here, and the branch name now has an asterisk on it. If I try to switch to another branch that causes major changes, like, say, 07_03e, I may see a dialog box like this. If you don't care about saving your changes, you can simply hit the Force Checkout button. It will let you switch to that branch. You can then choose to discard the changes on this file. Your instructor will let you know what the folder structure is for your course. Forking let's you create your own copy of the repository on your account, so that you can keep any changes that you've made. Even if you've deleted the codespace. To create your own fork, you can click on the Fork button on the repository. I'm going to hit Create fork. Now I have my own copy of this repository. And if I want to, I can start a new codespace on that fork. This forked version is almost exactly like the original repository, but it will let you push your own changes. Notice that the URL of the repository is slightly different. Let's go ahead and make a simple change to this file right here. I'm going to save it. You'll note that there is an M right here, as well as an asterisk on this branch. In the source control panel, you can also see a 1 for the change that we just made. Let's go ahead and try to commit this change. I'm going to hit the Commit button. And I'll ask it to go ahead and stage the changes, and then I'm going to hit this button here, I'll hit OK. You can also let it go ahead and run git fetch. That way it'll automatically sync with your forked repo. Now that change will be stored in your own version of this repository. Don't worry. If you forget to fork a repo and then try to push changes, Codespaces will also ask you if you want to create a fork automatically. Look for additional course specific tips from the instructor. Now, let's get back to the course.

Contents