Javascript 从sourcetree中打开sourcetree中ssh的git url
我想从html页面克隆sourcetree中的git url或git ssh url Bitbucket是这样做的:Javascript 从sourcetree中打开sourcetree中ssh的git url,javascript,html,git,Javascript,Html,Git,我想从html页面克隆sourcetree中的git url或git ssh url Bitbucket是这样做的: sourcetree://cloneRepo?type=stash&cloneUrl=ssh://git@link.toRepository.com/repositoryName.git 我已在源代码中搜索,但找不到如何在Mac/Windows应用程序中打开某些内容。有人能帮我解决这个问题吗?经过漫长的探索,我找到了答案 原来Sourcetree有一个自定义url协议S
sourcetree://cloneRepo?type=stash&cloneUrl=ssh://git@link.toRepository.com/repositoryName.git
我已在源代码中搜索,但找不到如何在Mac/Windows应用程序中打开某些内容。有人能帮我解决这个问题吗?经过漫长的探索,我找到了答案 原来Sourcetree有一个自定义url协议Sourcetree。您可以使用它来触发Sourcetree以打开和克隆url 克隆回购: sourcetree://cloneRepo/ 如果未安装github Desktop,Mac也将处理github触发器: github mac://url 发行说明向下滚动至1.4: javascript的一个例子:
downloadRepo(url){
const customUrlProtocolSourceTree = "sourcetree://cloneRepo/"
window.location.href = customUrlProtocolSourceTree + url
}
如果将来有人对此有问题,我发现如下: 要打开Sourcetree,您必须预先设置sourcetee://cloneRepo 就像@Koen Van Looveren说的,但是URL必须如下所示:
sourcetree://cloneRepo?type=stash&cloneUrl=ssh://git@link.toRepository.com/repositoryName.git
希望它能帮助有同样问题的人 来源是什么?请在bitbucket的来源中提供更多信息