无法使用应用程序密码通过 Visual Studio Code 登录 Bitbucket Repo

Mui*_*rik 5 git bitbucket

我最近为 bitbucket 设置了一个应用程序密码,因为从 3 月 1 日起,当我通过 Mac 上的 Visual Studio Code 连接到存储库时,他们要求使用此密码。

然而,我现在实际上很难连接。在 Visual Studio Code 中加载一个我之前已经克隆的项目后,我在终端中输入了以下内容:

git remote set-url origin https://<firstname.lastname>:<app-password>@bitbucket.org/<organization>
Run Code Online (Sandbox Code Playgroud)

然后当我尝试时git push origin feature-branch

我在终端中收到以下错误:

remote: Invalid credentials
fatal: Authentication failed for 'https://bitbucket.org/<organization>/'
Run Code Online (Sandbox Code Playgroud)

我在这里缺少什么?

顺便说一下,我从这里得到了上述说明:How to access bitbucket using app password

顺便说一句,我也尝试过:

git remote set-url origin https://<firstname.lastname>:<app-password>@bitbucket.org/<organization>.git
Run Code Online (Sandbox Code Playgroud)

另外,理想情况下,我想设置全局凭据,因为我将始终针对同一组织帐户,但其中有不同的存储库。有什么想法如何做到这一点?

Mui*_*rik 2

最后,在尝试了很多很多不同的命令行条目并阅读了不太清晰的文档之后,我能够让它与 Curl 一起使用:

curl -u "<user>:<appPassword>" "https://api.bitbucket.org/<rootOrg>"
Run Code Online (Sandbox Code Playgroud)

换句话说,举个例子:

curl -u "bill.smith:h8sdgj0dkdjjf0s00f" "https://api.bitbucket.org/superorg"
Run Code Online (Sandbox Code Playgroud)