From the course: Complete Guide to Git

Unlock the full course today

Join today to access over 24,000 courses taught by industry experts.

Prune stale branches

Prune stale branches - Git Tutorial

From the course: Complete Guide to Git

Prune stale branches

- [Narrator] In this movie, we will learn how to prune stale branches and learn when it is necessary. Pruning means to delete all of the stale branches. And a stale branch is a remote-tracking branch, which no longer tracks anything because the actual branch in the remote repository has been deleted. When we work with remote branches, there may be three different branches. There's the remote branch that actually exists in the remote repository, then there's the local snapshot of that remote branch, and then there's our local branch. If our branch was called bugfix, we could have a version on the remote called bugfix, we could have a local branch called bugfix, and in between is a snapshot of the remote branch, which is the remote-tracking branch. We've learned how to delete a local branch, and we learned how to delete a remote branch. But what about this remote-tracking branch? If I delete a remote branch, Git will automatically delete the remote-tracking branch at the same time…

Contents