How to change folder path of existing bookmark all at once?

My SourceTree is on OSX 10.8.3

I like to move existing project folders somewhere else, but there seems to be no easy way to change the folder path on existing bookmarks. The project folder under SourceTree preferences is merely for future new addition. For existing ones, I have to change it one by one.

Anyone knows how to change the folder path on existing bookmarks all at once?

2 answers

1 accepted

Hi Sean,

You'd have to modify the browser.plist file for SourceTree. I'd be very careful modifying this file though as if it's corrupt then SourceTree will have a hard time reading it. I recommend backing up this file first. It's located in /Users/<user>/Library/Application Support/SourceTree. Strangely, TextMate can't seem to read a plist file on my system, but TextWrangler managed it fine as it's just an XML file.

Step 1: Within this XML file you'll see your repository name immediately followed by the path to the repository. So, and I'm sure you guessed it, you can just do a find/replace. A caveat is that you could still wreck other repositories if your find/replace isn't specific enough. Using my repositories as example, if I suddenly decided to move everything up a level I'd do a replace on "/Users/Kieran/Documents/Development/" and change it to "/Users/Kieran/Documents/".

Step 2: Now you need to move your actual repository folders, "mv" doesn't allow wildcards in either operands so you'll need to use a loop for this, and you'll also only want to list directories. So you'd need something along the lines of:

for folder in `find . -type d -maxdepth 1 -not -name .` ; do
	mv -v $folder &lt;wherever&gt;

Basically test the mv command so your folders go to the right place. Hopefully that should get the ball rolling for you.


I need to modify that file too because I had to change the name of the underlying hard drive where everything is saved.

However on my system, that file (browser.plist) looks like it's binary, it's certainly not XML.

I tried using a PList Editor but it just told me the file was corrupted.

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,110 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