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

Delete branches

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

Start my 1-month free trial

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…

Contents