日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 >

【错误记录】Android Studio 向 GitHub 提交代码报错 ( Push failed: Failed with error: Could not read from remote )

發(fā)布時間:2025/6/17 61 豆豆
生活随笔 收集整理的這篇文章主要介紹了 【错误记录】Android Studio 向 GitHub 提交代码报错 ( Push failed: Failed with error: Could not read from remote ) 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

文章目錄

  • 一、報錯信息
  • 二、解決方案





一、報錯信息



在 Android Studio 中首次向 GitHub 提交代碼 , 報錯 :

Push failed: Failed with error: Could not read from remote repository.





二、解決方案



將 設(shè)置中的 Git 的 SSH executable 設(shè)置為 Native ;

打開 Git 安裝目錄下的 bin/bash , 在命令行中輸入

ssh-keygen -t rsa -C "han1202012"

其中 han1202012 是 GitHub 賬號 ;

點擊 333 次回車 ;

octopus@DESKTOP-0EUIENB MINGW64 /bin $ ssh-keygen -t rsa -C "han1202012" Generating public/private rsa key pair. Enter file in which to save the key (/c/Users/octop/.ssh/id_rsa): Created directory '/c/Users/octop/.ssh'. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /c/Users/octop/.ssh/id_rsa. Your public key has been saved in /c/Users/octop/.ssh/id_rsa.pub. The key fingerprint is: SHA256:pklRhEXgBzBDx3+zYponKSlrK7JsAPTncT78O6hGp4A han1202012 The key's randomart image is: +---[RSA 3072]----+ | .=o+*= | | . =oo | |. . o.. | |. . o +. o | |. . o * S. o | |.E . + Oo . | |. o.==+. | |+.o oo=..o | |+=o+.o.o .o | +----[SHA256]-----+octopus@DESKTOP-0EUIENB MINGW64 /bin $

進入 C:\Users\octop\.ssh 目錄 , 需要使用 id_rsa.pub 中的內(nèi)容 ;

C:\Users\octop.ssh\id_rsa.pub 文件的內(nèi)容為 :

ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDl+Ph2KiYOx3ABXGowLzB8Mb4uz7NcEaK0xfxzeTb173QWjSNC0H61nkP1aZX94A2r83kO1dIHoHSwxalGRLh6wL9vUJUq/XqvLGxUjcPDTVgztU/RR9Sw2aVFTPE9nWcZHvysnC3ST37iRMj+kUc2eWZ15UjgUZ+5xNh+e5kh80JAtJrJTSmyeyTI42UllGmDtVK0QWZAIylIcB2pS2vUDbrQFDtJOfIF6GvTReTWxQNH611TaQ+bIQpm9PgIcodO/vAWqer7i8xGv0BRObdUsl7ACq3FJOFuLsOqeR5DJVdgMcInP+tHO6dPFrQ6kX24a9oixpkOKaqK/rb7cH0xqUR0mlxtSe2EavnfmDhK1ejesbSYPH93Den92izhrW212fQMtKGrIxon1aaaRuIZnO1uccOzbfAnSz7F9SiyqAPvY03TlotHTlbMsTRPtjlNj6A4sxT9WbxdbZjanPplfgVhps1GLno3l91XZNXXO/Nq+VejK00ktUa5dbWQDi0= han1202012

進入到 GitHub 中 ;

進入提交錯誤的工程的額 Settings 選項 ;

選擇 Deploy Keys 選項卡 , 然后點擊 " Add deploy key " 按鈕 ;

將 C:\Users\octop.ssh\id_rsa.pub 文件的內(nèi)容拷貝到 Key 中 ;

設(shè)置完畢 ;

總結(jié)

以上是生活随笔為你收集整理的【错误记录】Android Studio 向 GitHub 提交代码报错 ( Push failed: Failed with error: Could not read from remote )的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。