VS 代码无法使用 SSH 从 Bitbucket 推送和拉取

VS code unable to use SSH to push and pull from Bitbucket

目前,我正在使用源代码树通过 SSH 从 Bitbucket 进行推送和拉取。

然而,当我尝试使用 VS Code 做同样的事情时,它要求输入密码。

输入 Bitbucket 密码后出现以下错误:

remote: Invalid username or password
fatal: Authentication failed for 'https://bitbucket.org/repo/repo.git/'

我搜索了几篇文章,但似乎没有任何效果。

我使用的是 M1 Macbook - OS 大苏尔。 这是我的专业 Bitbucket 帐户。

这是我关注的文档之一:https://support.atlassian.com/bitbucket-cloud/docs/set-up-an-ssh-key/

尝试切换到命令行,然后转到本地存储库的根文件夹。

git remote -v 检查你的远程 URL:如果它以 https:// 开头,它不会使用 SSH。完全没有。

切换到 ssh:git remote set-url origin git@bitbucket.org:<me>/<MyRepo><me><myRepo> 是您要替换的占位符值:不要使用 <>
还要测试您的 SSH 密钥是否正确 registered to your BitBucket account: ssh -Tv git@bitbucket.org.

然后切换回 VSCode,看看您的问题是否仍然存在。