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] Another technique for working with modified files so that you can switch your branch is to commit the changes to the existing branch. So let's make one more change to the string, save the changes, look at git status. We're going to commit the files, so I'll call git commit, and then I need a switch here. A means to stage all the files, any files that have changed, M means I want to set the message, and then I use a string here for the message. You see that I see one file was changed, one insertion, one deletion, and then I will do a git status. It's telling me that my branch is ahead of origin by two commits and I can then call git push to publish local commits, I'm not going to do that. But go ahead and switch branches here. See that we can successfully do this. So now we've seen three techniques for handling modifications: commit, restore, and stash.

Contents