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 widget could not be displayed.

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.

This widget could not be displayed.

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).

This widget could not be displayed.

Thanks for explanation!

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Monday in Teamwork

The tools we make for teams? We use them every day at Atlassian to get shit done (and it works).

I’m Jess, a Product Marketer for Jira Software Server and Data Center, and now a huge fan of our products. Read on for a 90 day, new-hire perspective on what it’s like to standardize on the Atlassian...

43 views 0 3
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