2017-12-27 1201 views
1

我一直在爲這個問題奮鬥了幾天。Git失敗,出現致命錯誤。無法讀取用戶名

我無法連接到我的Git項目(存儲在VisualStudio.com)從一臺特定的計算機(它在我的第二臺PC上工作)。每當我嘗試同步或克隆我的倉庫,VS2017詢問我的用戶憑據(兩次)和我收到以下錯誤:如果我改變可能已經造成的任何

Error: cannot spawn askpass: No such file or directory Error encountered while cloning the remote repository: Git failed with a fatal error. could not read Username for 'https://.visualstudio.com': terminal prompts disabled

不記得..

回答

3

這主要是由於憑證已被憑證管理員記住。您應該刪除存儲在Credential Manager中的xxx.visualstudio.com的憑據。

例如,如果PC的操作系統是Windows,您可以打開憑證管理器 - > Windows憑證 - >通用憑證 - >刪除憑證,如git:https://xxx.visualstudio.com

enter image description here

然後再克隆,GIT中會讓你輸入該證書的回購。輸入可訪問VSTS帳戶的用戶名(電子郵件地址)和密碼後,應該克隆成功。

+0

工作正常!謝謝!!! – danbord

+0

我遵循了這些步驟,但它並沒有爲我工作。我使用VS2017並嘗試連接到VSTS git項目。我遇到錯誤 推送到遠程存儲庫時遇到錯誤:Git失敗,出現致命錯誤。 遇到Win32Exception。 無法寫入證書 不能產卵askpass:沒有這樣的文件或目錄 不能爲「https://xxxxxx.visualstudio.com」讀取用戶名:終端提示禁用 推到https://xxxxxx.visualstudio.com/_git/StockTrace –

1

只需將您的Visual Studio更新到最新版本即可。這個錯誤已被報告,並被最新的更新修復。爲我工作。

+0

而且應該不可能,因爲你沒有管理權限; git遠程設置網址來源用戶名:[email protected]/username/repo.git - 爲我工作。注意:將在./git/config中以明文形式存儲您的github密碼 –

相關問題