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

Sean Lee April 14, 2013

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

2 votes
Answer accepted
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.
April 14, 2013

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:

#!/bin/bash
for folder in `find . -type d -maxdepth 1 -not -name .` ; do
	mv -v $folder &lt;wherever&gt;
done

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

Cheers

0 votes
David Jameson November 8, 2015

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
TAGS
AUG Leaders

Atlassian Community Events