sourcetree needs to refer to new location, old branches are still there

We recently migrated our backend repository and had to make some changes in our local dev environments.  We are basically going to lose our branch history and starting over with a single develop branch.  The problem is in sourcetree I see all the old branches, even though I renamed the top level folder so I wouldn't accidentally edit the wrong flies or do something along those lines.

How do I get sourcetree to point to the correct (new) folder and get rid of references to the old ones?


1 answer

The top level folder name is irrelevant. If the top level folder contains the same .git folder, then you are working with the same repository.

I'm not sure what you mean by "branch history". Do you want to lose your entire commit history? If so, you can delete the .git folder, then use SourceTree to create a new repository in that directory. You can then commit the entire contents as a massive "initial commit".

If you don't want to lose your entire commit history, then I'm not sure what you're looking for is possible without doing some sort of interactive rebase of your entire git history.

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
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 ...

649 views 0 4
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