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

Commit local branch changes - GitHub Tutorial

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

Commit local branch changes

- [Instructor] When you're finished working through a video, at the end you will have made changes to your local code and, if you want, you can save those changes locally. In Git that's called a commit operation. So once again, I've added a new line of code to this file and I've saved it to my local disk. And when I look at GitHub Desktop, I see the changed file listed here. I can now commit my changes. To do that, first enter a commit message. I'll say, "Changed the main file." You can add a description if you like, but that's optional. And then just click on the Commit button at the bottom and that's it. Your changes have been saved locally. Now, if you want to revert that immediately, notice there's an Undo button right here. But typically, you'll do this at the end of the video after you've made those changes. And again, as I mentioned, you need to resolve your changes before you move to the next branch. So I've committed those changes locally and I could now go to my branch list and look for 02_04, and I'll choose the beginning state and check it out, and now the files will be in the beginning state for that video and I'm ready to watch that video and follow along.

Contents