How do I delete all local branches in SourceTree

My local branches in SourceTree seem to be out of sync. When I check out a branch from the origin some files are missing. So I would like to delete all local branches so that sourctree(git) does not think there any local files and will copy all files from origin repository. I can not delete the local branch that is is active (option is greyed out). Is there any way to totally delete the local branches so I can start cleanly and get a full check out?

1 answer

1 accepted

2 votes
Answer accepted
Jeff Thomas Atlassian Team Nov 16, 2013

What about deleting the local repository and re-cloning it from the remote server? That would wipe out the local branches and let you have a clean copy of the repository. This would delete any local commits you've made that have not been pushed to the server.

If you remove the bookmark in SourceTree, you'll also being given the option to remove it from the disk, which will wipe it out.

That does it. I was hoping to just do some sort of forced resync but I can't find anything git like that.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Oct 23, 2018 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...

1,230 views 4 2
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