Why hello there!
I have an existing local git repository bookmarked in my version of SourceTree. Simply I wish to view it in SourceTree by use of a URL. Does the sourcetree URL scheme enable this?
I see that the following already is supported:
It also appears that 'openRepo' is supported by github-windows, github-mac and gittower URL schemes.
Unfortunately, I'm not able to find the SourceTree URL scheme anywhere online, and so I can't tell whether anything like openRepo, openBookmark or openWorkingCopy are supported (and testing various URLs has not been successful).
Any help would be hugely appreciated.
Regards,
Raphael
I just received the automated 'Open question reminder' from Atlassian Answers. Based upon my own fairly extensive research and testing, and also in part due to the lack of a definitive answer above, it seems that the sourcetree:// scheme does not support being able to open or view a repository without first cloning it.
At Seth Foss' suggestion last week, I created https://jira.atlassian.com/browse/SRCTREE-2180in order to request the feature.
Eventually I created my own custom URL scheme using an application wrapper that I created and called Stree.app. I can now run the following URL in order to view a local repo in SourceTree:
stree:///path/to/repo/
In brief, I based my code upon the useful information at http://drosophiliac.com/2012/09/creating-a-custom-url-scheme-via-applescript-and-python.html.
For those interested, I created the application in AppleScript Editor containing the following code:
on open location streeURL set oldDelims to AppleScript's text item delimiters set newDelims to {"stree://"} set AppleScript's text item delimiters to newDelims set repoPath to item 2 of the text items of streeURL set AppleScript's text item delimiters to oldDelims tell application "SourceTree" open repoPath activate end tell end open location
And then, in the Info.plist contained within the "Contents" directory of the application's package contents (right-click on the app to "Show Package Contents"), I added the following just above the final closing </dict> tag.
<key>CFBundleIdentifier</key> <string>com.AppleScript.Stree</string> <key>CFBundleURLTypes</key> <array> <dict> <key>CFBundleURLName</key> <string>Stree</string> <key>CFBundleURLSchemes</key> <array> <string>stree</string> </array> </dict> </array>
I can't vouch that it is 100% correct, but it is certainly correct enough :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Cool. You might also file a feature request at jira.atlassian.com.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't think SourceTree is able to view any repositories that aren't local (or at least present on locally-mounted storage). If a repository is local, why would you need a URL to view it?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for your response, Seth. I am using a project management tool and I wish to incorporate a SourceTree URL into my project such that one click will open SourceTree at the associated repository.
I would be surprised if the URL scheme accomodates cloning / checking-out but not viewing, given that viewing is a much simpler operation.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.