我创建了一个 BitBucket.org 帐户,并能够使用命令行创建本地和远程存储库。我在 Mac 上使用带有名为 id_rsa(和 id_rsa.pub)的密钥的 ssh。 命令行运行良好,命令“ssh -T [email protected]”也按预期返回了良好的状态。 但是,当我尝试设置 SourceTree 以访问同一个存储库时,它始终不起作用。
它让我添加带有 OAuth 身份验证和协议 SSH 的帐户。然后我点击了“连接帐户”按钮,它把我带到了 BitBucket 并且让我确定了 SourceTree 请求许可更新一堆东西的事实。我同意了,这让我回到了 Sourcetree 来完成。 我完成了设置,但它不会工作。 我还单击了复制到剪贴板按钮以获取它正在使用的 id_rsa.pub 密钥的副本。它与我已经在 BitBucket 上输入的相同(我什至尝试重新输入它并得到相同的结果 - CLI 工作但 SourceTree 不工作)。
我找到了sourcetree的日志,它似乎只是记录:
2023-02-22 02:50:45 +0000 (e) recordGASEvent={ 代码= 0; 消息=“”; 成功 = 1; 验证错误 = ""; } 2023-02-22 02:51:03 +0000 (e) 为 Bitbucket 云帐户获取用户拥有的存储库失败。错误 - {"type": "error", "error": {"message": "No workspace with identifier '{9e397f1a-98e2-42bf-8fc1-13aef9e0bece}'."}}
看起来 ssh 可能正在工作,但还有其他一些权限问题?就像我说的,所有 git 命令都可以在命令行中正常工作。
geof@Geofs-MacBook hellobitbucket % git status
On branch main
Your branch is ahead of 'origin/main' by 1 commit.
(use "git push" to publish your local commits)
nothing to commit, working tree clean
geof@Geofs-MacBook hellobitbucket % git push
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 4 threads
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 269 bytes | 269.00 KiB/s, done.
Total 3 (delta 1), reused 0 (delta 0), pack-reused 0
To bitbucket.org:geofg/hellobitbucket.git
12148bc..f051b18 main -> main
geof@Geofs-MacBook hellobitbucket % ssh -T [email protected]
authenticated via ssh key.
You can use git to connect to Bitbucket. Shell access is disabled
geof@Geofs-MacBook hellobitbucket %