Sourcetree Refresh branches

Is there a way that my remote branches can be refreshed in source tree? For example, if there is a branch that developer A pushed up to origin, and then deleted from origin, then that branch still displays on my view in source tree under remotes. The strange thing is that I can still check out this remote branch, even though it was deleted and is no longer visable via stash.

4 answers

1 accepted

Another option is to use the explicit 'Fetch' button on the toolbar and check the 'Prune' option. This will remove all remote branches which you have a local record of, but are no longer actually present on the remote.

Hi David,

By default Git does the safe thing and never deletes a remote branch unless explictly asked (which is a good thing IMHO). What you really want is to 'prune' your remote:

https://answers.atlassian.com/questions/63377/how-can-i-remote-prune-origin-in-sourcetree

Cheers,

Charles

Thank you for your answer, this helps a lot in keeping everything cleaned up.

Hi David,

This is because we auto-fetch remotes. A pull just merges fetched branches which is why it's still possible when the remote branch has been deleted. You can just delete the branch locally to get rid of it.

Hope that helps

And how does one know that it's OK to "locally" delete the branch on origin?

0 votes

i am using source tree version 2.3.5.0 which is unable to fetch remote branches locally.

 

i used Fetch option.it is unable to pull all remote branches locally

i am unable to delete my post above. how to delete above post?

Suggest an answer

Log in or Join to answer
Community showcase
Brian Ganninger
Published Jan 23, 2018 in Sourcetree

Tip from the team: workflow and keyboard shortcuts

Supported Platforms macOS Sourcetree has a lot to offer and, like many developer tools, finding and using it all can be a challenge, especially for a new user. Everyone might not love ...

231 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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot