remote branches are not removed from the list after being deleted

I have few remote repositories configured for my project, whenever a new branch created it shows up under the remore repository, but when they are deleted later on, they are not removed from the list and there is no way to remove them unless I remove the remote repository and add it again

3 answers

1 accepted

This is because git always keeps a local record of the remote branch.

To remove these local records, use the Fetch toolbar button and check the 'Prune' option.

That didn't do it. The branches are still there in the sidebar in the "remotes" section under my origin :( This list clutters very fast (though these branches are not present in bitbucket web list of branches)

You can remove those branch labels that no longer exist on your remote by expanding your Remotes in the sidebar and right-click the branch name and choose delete.

I am having the same issue. I selected "Fetch" then "Fetch from all remotes" and "Prune tracking branches...". Reloaded SourceTree and they were still there. I then tried to right click and "Force Delete" them but I get an error saying they no longer exist... I tried restarting SourceTree after that too and no luck :(

Same here as @Crystal O'Mara, it never removes them after sync and prune. If you're using feature branches, then tens/hundreds of branches fill the list and it is unusable!

If anyone is still having issues with dangling remote branches following a fetch and prune, try deleting your project and then cloning it down again. Sourcetree then correctly located my branches in a different sub-folder (which was capitalized) and succeeded in deleting them permanently.

What can be the reason when local branch is not pruned after fetching?

Local branches are never removed by 'git fetch --prune'. Fetch only affects remote branches (i.e. your local record of what the remote branches are).

Thanks for explanation!

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Brian Keough
Published yesterday in Training & Certification

The Project Administration in Jira Server Certification is here!

The Atlassian Certification you've been waiting for is here for good. We're thrilled to announce the official launch of our new Certification for Project Administration in Jira Server! The offering ...

84 views 0 10
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you