From the course: Git: Branches, Merges, and Remotes

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Switch branches with uncommitted changes

Switch branches with uncommitted changes

From the course: Git: Branches, Merges, and Remotes

Start my 1-month free trial

Switch branches with uncommitted changes

- [Narrator] We've seen how easy it is to switch branches in Git. But there is a potential road block, that can keep us from switching, and I want us to look at it. Inside my Explore California project, I already have a couple of branches. You can see I have Master, New Feature, and Shorten Title. The currently checked out branch is Shorten Title. You can type Git Status. We can see that currently, I have nothing to commit. Everything has been committed, my working directory is clean. Let's now make a change. Let's go into our project, and let's change Explore California from being a dash, to being a colon. So I'm just going to make that one tiny little change. Let's save it. Now, I have a change. If I type Git Status, you'll see that the change is there. These changes are not committed. Let's try it. Let's type Git Checkout Master. Git won't let us do it. And it tells us, it says your local changes to the following files would be overwritten by checkout: index.html. Then it tells us,…

Contents