Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
badges earned

Your Points Tracker
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to automatically remove remote repositories from SourceTree that have been deleted?

I find that a growing list of remote repositories, which have been created by my colleagues are not automatically deleted when removed from GitHub. When I manually delete them I get an error stating that they don't exists. How can I make SourceTree automatically manage and remove these remote repos when they are removed by my peers?

4 answers

That's against the principles of distributed version control system, which do not have a main/reference location for a repository by concept. It's only a convention that most of us consider github/Bitbucket as a reference location for repositories - but that's not part of the distrubuted VCS strategy of git. SourceTree implements only the concepts of git here ... so there is no automatic deletion of your repository, when the reference repository is deleted.

Assumed the following case: Your repository is hosted on github as well as on bitbucket. You might have configured both of them as remote repositories - what shall happen, if the refernce repository is deleted on github? Should it be deleted - unless you have configured a second reference repository?


Either you  misunderstood my question or I misunderstood your answer. My apologies if I'm a little confused.

First of all, in the scenario you presented, I would not expect either the second remote repository or the local repository to be deleted. What I would expect is that the UI would be updated so that it was obvious to me that the remote GitHub repository no longer existed, due to deletion. This would leave my local copy and the remote copy on Bitbucket unaffected.

My issus is that I have indications that remote repositories exist when indeed they do not. I would have expected the pull command to update the tracking references thereby updating the status of remote repositories.

I think he's asking for the remote refs to be deleted, not the local repos themselves (that would obviously be madness)

Sorry for confusion - I misunderstood your question (as 'm not a native english speaker I sometimes miss some details in wording wink)

Within SourceTree, I haven't seen the option to delete your local remote refs after the remote repository being deleted.

Hey, it is 2018. Is there now a solution for the problem?

How are you manually deleting them?  I haven't found a way to do it automatically, but when I delete a remote repo on my server and then in SourceTree go to Repository->Repository Settings->Remotes and delete a remote, I don't get any error.


The issue here is really about synchronization more than manual or automatic deletion of remote references. I'm not the one deleting the remote repositories. What happens is that I and my teammates submit code for review on temporary branches. When these branches are merged, whomever performed the code review and merge then deletes said temporary branch. So, over time, I have references to these remote branches that no longer exist accumulating in my instance of SourceTree. The included image is an example of the accumulation I'm referring to. Most of these branches don't exist anymore. It would be nice if I didn't have to attempt to delete them in order to figure that out.

Screen Shot 2016-02-02 at 19.35.53.png

Ah, remote branches, rather than the remotes themselves, is your problem.  Your question cited "remote repositories" which made me think it was the whole repo that had been deleted off the server.  

That actually makes more sense; yes, I've been plagued by that too.  

I believed i had the same problem. The repository had been deleted from BitBucket but the bookmark for the repository still appeared in SourceTree. 

I fixed it by deleting the local repository folder on my hard-drive then once the bookmark in sourcetree said the folder had been deleted i clicked on the bookmark and selected delete bookmark.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Sourcetree

Tip from the team: configure your repos for hosting goodness!

Supported Platforms macOS Windows We recently introduced support for additional hosting services such as GitHub Enterprise, GitLab (Cloud, Community Edition, Enterprise Edition), and...

3,289 views 4 5
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you