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?
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 <wherever> done
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.
Supported Platforms macOS Windows To make using Sourcetree as simple yet powerful as possible we embed (bundle) dependencies such as Git, Git LFS, and Mercurial. We strive to keep these...
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!
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