Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Sourcetree Refresh branches

dsmoore1600 July 29, 2013

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

85 votes
Answer accepted
stevestreeting
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 30, 2013

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.

4 votes
cofarrell
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 29, 2013

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

dsmoore1600 July 29, 2013

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

2 votes
KieranA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 29, 2013

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

Lawrence Dol March 25, 2016

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

0 votes
marpua January 5, 2018

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

marpua January 5, 2018

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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events