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.
Delete branches
- [Teacher] We've learned how to create branches, work with them, and even rename them. Now let's learn how to delete them. So first, let's remind ourselves what branches we have. You can see that I'm currently on the SEO title branch. Let's all switch to the master branch. Whatever branch you're on, let's switch to the master branch and we're going to do that with checkout. Git checkout master. And I want us to all be on the master branch 'cause I want us to create a new branch from here. So I'm going to use git branch to create that branch. I'm going to call it branch to delete with underscores. And notice I'm just using the branch command, not checkout dash B. So that means that I created the branch but I did not switch to it. That's important. If you actually did the checkout dash B option, that's fine, just now checkout master again, so that you're on the master branch. If we want to delete this branch, it's pretty simple. We just type git branch and then use the dash D option in…
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)
-
-
-
-
-
-