AS與Pycharm git push報錯:Invocation failed Server returned invalid Response, Authentication failed

Android Studio git報錯及解決方法

Android Studio畢竟和Pycharm一家,不過網上查找到的這個問題關於AS的解決方法倒是挺多,這裏簡單提一下。

Invocation failed Unexpected Response from Server: Unauthorized

解決方法:

AndroidStudio -> Preferences -> Git -> SSH Executable and changed from Native to Built-in and it started working.

原因:SSH key pair對密碼的保護,如果選擇native的ssh executable 則AS並不提示你輸入密碼,所以最後認證會失敗。但是如果設置了built-in,則會提示輸入密碼,這樣就認證成功了。

Pycharm git push報錯及解決方法

Push failed: Unable to access ‘https://github.com/BierOne/bottom-up-attention-vqa.git/’: Could not resolve host: github.com

解決方法及原因:

這個報錯很明顯是網絡問題,建議重新連接一下網絡,一般在這個位置能正常顯示頭像,即網絡沒有問題了。
在這裏插入圖片描述

Push failed Invocation failed Server returned invalid Response. Authentication failed for

解決方法及原因:因爲我的pycharm中並沒有built-in選項,所以AS的方法就不適用了。我的解決措施是在Git欄勾選Use credential helper,就是身份認證助手:
在這裏插入圖片描述
這樣在認證的時候就會提示你輸入密碼了,即可正常通過身份驗證。另外還有其他的解決方法,不過都大同小異。

另外,也可以試着在添加github賬號的時候使用token,應該可以一勞永逸:

在github官網賬戶的settings page下選擇create new token,然後複製即可

參考鏈接

  1. https://stackoverflow.com/questions/22348093/pycharm-github-push-failed-fatal-authentication-failed
  2. https://askubuntu.com/questions/436610/intellij-unable-to-fetch-from-git
  3. https://stackoverflow.com/questions/55783219/how-to-fix-invocation-failed-unexpected-response-from-server-unauthorized-in-an
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章