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 a remote branch

Delete a remote branch

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

Start my 1-month free trial

Delete a remote branch

- Now that we know how to create and work with remote branches, I also want us to learn how to delete them. When I talk about deleting a remote branch, I'm talking about removing the branch from the remote repository, not the local repository. The local repository can still keep the branch, I'm telling git hub that it ought to remove this branch. You can remove remote branches any time but it's most useful whenever a feature branch has been completed and merged. So, let's imagine that you have a master branch, you branch off of that to make a feature branch, you work on that feature for a couple of days, when the feature is finally complete, you merge it back into master. Now I don't need that feature branch anymore. You may want to leave it around for a few days, but at some point those feature branches start to accumulate and we need to get rid of them. So we want to tell git hub that it can get rid of them and maybe we want to remove them from our local repository as well. Right…

Contents