簡體   English   中英

用於 git 身份驗證的應用程序密碼(bitbucket 和 sourcetree)

[英]App passwords for git authentication(bitbucket and sourcetree)

當我嘗試推送時,sourcetree 顯示以下錯誤。

git -c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks push -v --tags ruling master:master
remote: Bitbucket Cloud recently stopped supporting account passwords for Git authentication.
remote: See our community post for more details: https://atlassian.community/t5/x/x/ba-p/1948231
remote: App passwords are recommended for most use cases and can be created in your Personal settings:
remote: https://bitbucket.org/account/settings/app-passwords/
fatal: Authentication failed for 'https://bitbucket.org/xxxxxxx/ruling.git/'

所以我去了https://bitbucket.org/account/settings/app-passwords/創建了應用程序密碼,添加了密碼標簽和 Select 權限。

但是,推送仍然不起作用,並且出現相同的錯誤消息。

在那之后,我不知道該怎么辦。 請告訴我下一步該怎么做。

在 Windows 上,導航到

C:\Users\<UserName>\AppData\Local\Atlassian\Sourcetree並刪除passwd文件。

  • 請注意,刪除此文件后,Sourcetree for Windows 最終可能會再次提示您輸入密碼。

以下鏈接中提到了另外兩個潛在的解決方案,但對我來說,上述方法有效:

https://community.atlassian.com/t5/Sourcetree-articles/Bug-Fix-Sourcetree-for-Windows-authentication-error-when/ba-p/1965968

除了其他答案之外,這里還有一個對我有用的提示:

當我切換到 bitbucket 應用程序密碼時,我在 Sourcetree 中遇到了同樣的問題。 我也重新安裝了 Sourcetree,但沒有運氣。

我嘗試再次重新安裝,但這次我在完成身份驗證過程和安裝后退出了該瀏覽器窗口(顯示身份驗證成功)。 然后我嘗試在工具 > 選項 > 身份驗證中使用基本身份驗證,它起作用了。

我注意到的不同之處是:當我從瀏覽器中注銷時,Sourcetree 為應用程序密碼提升,而我登錄時沒有。

我有一個適合我的不同解決方案,我在尋找這個問題時還沒有看到。

在 SourceTree、Tools/Options/Authentication 和 select 中,帳戶不起作用。 然后 select“編輯”,它應該打開一個 window“編輯主機帳戶”。

我使用 OAuth 作為憑據。 我單擊“刷新 OAuth 令牌”按鈕,它打開了一個空白瀏覽器 window,指向本地主機 URL。在編輯主機帳戶 window 的底部,有一個綠色復選框,上面寫着“身份驗證確定”。 然后我的 Push 又起作用了。

編輯主機帳戶窗口

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM