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
From the course: Git: Branches, Merges, and Remotes
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,…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
(Locked)
Branching overview4m 33s
-
(Locked)
Create branches3m 18s
-
(Locked)
Switch branches2m 27s
-
Create and switch branches3m 22s
-
(Locked)
Switch branches with uncommitted changes3m 39s
-
(Locked)
Compare branches4m 39s
-
(Locked)
Rename branches2m 21s
-
(Locked)
Delete branches4m
-
(Locked)
Configure command prompt6m 46s
-
(Locked)
-
-
-
-
-
-