Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more
5 of 8
Improved formatting, added syntax highlighting
user avatar
user avatar

Tip: When you delete branches using

git branch -d <branchname>    # deletes local branch

or

git push origin :<branchname> # deletes remote branch

only the references are deleted. Even though the branch is actually removed on the remote the references to it still exists in the local repositories of your team members. This means that for other team members the deleted branches are still visible when they do a git branch -a.

To solve this your team members can prune the deleted branches with

git remote prune <repository>

this is typically git remote prune origin.

pfrenssen
  • 5.5k
  • 1
  • 23
  • 16