1. 程式人生 > >【github常見操作和常見錯誤】錯誤提示:Permission denied (publickey). fatal: Could not read from remote repository.

【github常見操作和常見錯誤】錯誤提示:Permission denied (publickey). fatal: Could not read from remote repository.

(1)首先新建 SSH key,在git shell(或者git bash等命令視窗),注意大小寫:

$ ssh-keygen -t rsa -C “郵箱名”

然後會出現:

Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/dell/.ssh/id_rsa):

直接回車。
然後會出現:

Enter passphrase (empty for no passphrase):
Enter same passphrase again:

要求你輸入密碼,這個密碼會在你提交專案時使用,如果為空的話提交專案時則不用輸入。這個設定是防止別人往你的專案裡提交內容。

注意:輸入密碼的時候沒有*字樣的,直接輸入就好。
然後會出現:

Your identification has been saved in /c/Users/dell/.ssh/id_rsa.
Your public key has been saved in /c/Users/dell/.ssh/id_rsa.pub.
The key fingerprint is:
65:69:······02:4b [email protected]
The key’s randomart image is:
+–[ RSA 2048]—-+
| |
| . o . |
| . o o = o |
| . o * = o |
| E o + o . |
| . o. . . |
| .. |
+—————–+

至此,金鑰已經成功生成。

(2)接下來在github上新增SSH key:

① 開啟本地檔案:id_rsa.pub(檔案路徑可以在上一步SSH生成成功後看到路徑,比如我的是c:/Users/dell/.ssh/id_rsa.pub),可以將這個檔案在編輯器中開啟,然後全選複製。

② 登陸github,點選頭像位置處 Settings ——> SSH and GPG keys ——> New SSH key,點選新建SSH key。

③ 將 ① 中複製的內容貼上在key文字框裡,title可以不用填(或者自己起一個名字也可以)。

(3)測試設定是否成功:

$ ssh -T

[email protected]

有可能會出現:

The authenticity of host ‘github.com (192.30.252.1)’ can’t be established.
RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
Are you sure you want to continue connecting (yes/no)?

或者是

The authenticity of host ‘github.com (192.30.252.1)’ can’t be established.
RSA key fingerprint is nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)?

這種情況下,直接 yes 回車

然後會出現(也可能在 $ ssh -T [email protected] 之後,直接出現的就是這個,我就是這樣: ):

Hi username! You’ve successfully authenticated, but GitHub does not
provide shell access.

(4)設定使用者資訊:

git config –global user.name “使用者名稱”
git config –global user.email “你希望的郵箱名”

(5)然後就可以部署你的部落格到github啦~

接著就可以push到倉庫啦

補充:windows系統不要使用它自己的命令視窗!!!使用git shell或者 git bash 等之類的一些工具。

相關推薦

github常見操作常見錯誤錯誤提示Permission denied (publickey). fatal: Could not read from remote repository.

(1)首先新建 SSH key,在git shell(或者git bash等命令視窗),注意大小寫: $ ssh-keygen -t rsa -C “郵箱名” 然後會出現: Generating public/private rsa key

git常見的一些錯誤fatal: Could not read from remote repository. fatal: Not a git repository (or any of the

錯誤一:fatal: Not a git repository (or any of the parent directories): .git 此錯誤是因為你當前所在的資料夾還沒有git成本地倉庫,確保你是在作為本地倉庫的資料夾下,然後使用:git init   錯誤二:

git提示錯誤關於錯誤:ssh: Could not resolve hostname github.com: Name or service not known.fatal: Could not read from remote repository.

eight 無法讀取 主機名 github上 錯誤2 winsock nal file drive 關於 Git 使用中出現的錯誤 饑人谷_楠柒 關註 2016.11.02 15:33* 字數 746 閱讀 3607評論 5喜歡 10贊賞 1 關

Successfully created project on GitHub but initial push fail Could not read from remote repository.

最近由於給電腦升級,重新搭建了開發環境,但是Android studio 在分享專案到github上時,出現如下異常: 14:31 Can't finish GitHub sharing process Successfully created project 'todo_mvv

github常見操作常見錯誤

leg 我們 找到 指向 nec mailto 根目錄 常見操作 error: 如果輸入$ Git remote add origin [email protected]:github帳號名/項目名.git 提示出錯信息:fatal: remote o

github常見操作常見錯誤錯誤提示fatal: remote origin already exists.

空格 多余 因此 ear rem detail tco acs core 如果輸入$ git remote add origin [email protected]:djqiang(github帳號名)/gitdemo(項目名).git 提示出錯信息:fatal: re

github常見操作常見錯誤錯誤提示fatal: remote origin already exist

如果輸入$ git remote add origin [email protected]:djqiang(github帳號名)/gitdemo(專案名).git      提示出錯資訊:fatal: remote origin already exists.     解決辦法如下:     1、先

GitHub常見操作常見錯誤(fatal:remote origin already exists)(fatal: Couldn't find remote ref master)

    提示出錯資訊:fatal: remote origin already exists.     解決辦法如下:     1、先輸入$ git remote rm origin     3、如果輸入$ git remote rm origin 還是報錯

qt錯誤This application failed to start because it could not find or load

qt釋出exe無法執行,提示plugin windows錯誤 This application failed to start because it could not find or load the Qt platform plugin “window

hexo d 報錯‘fatal: could not read Username for 'https://github.com': No error’

問題描述 今天早上,一如往常的往在github上建立的hexo部落格上傳文章,結果報錯 ‘fatal: could not read Username for 'https://github.com': No error’ create mode 100644 2018/09/16/1537059562/i

fatal: could not read Username for 'https://github.com': No such file or directory

在建立git倉庫時遇到問題 github提示: git init git add README.md git commit -m “first commit” git remote add o

python習題常見操作概念

1. 常見操作 1> enumerate() // 返回序列的索引和元素 for i in enumerate([1,2,3]): // 返回list的索引和元素 for i in enumerate({'k1':1,'k2':2}): // 返回字典的索引和k

gitHub常見操作錯誤

    提示出錯資訊:fatal: remote origin already exists.     解決辦法如下:     1、先輸入$ git remote rm origin     3、如果輸入$ git remote rm origin 還是報錯的

均值不等式的常見使用技巧初級、中級高階輔導

代數 學習 arr arrow ase 分析 a+b rac 分享 常見的均值不等式的使用技巧 均值不等式這一素材,是高中數學中少見的幾個需要同時驗證成立的多條件素材。由於要多頭驗證,所以學生很不習慣,感覺很難掌握。 已知兩個正數\(a,b\),則有(當且僅當\(a=

Jmeter常見操作Charles抓包

con blank size 制作 jmx w命令 jdbc prop 連接mysql 一、jmeter常見操作 1、jmeter連接mysql數據庫 第一步:新建測試計劃→添加jdbc mysql jar包 第二步:新增JDBC Connection Configurat

spark的hive操作常見的bug

package hive import org.apache.spark.SparkConf import org.apache.spark.sql.SparkSession object HiveDome { def fun1(): Unit = { val conf = new Sp

Hibernate實現簡單的CRUD操作常見類(三)

  “兩個蝴蝶飛”特別喜歡"java1234知識分享網"小峰的實用主義,所以本文及其系列文章均是採用實用主義,從專案和程式碼的角度去分析。由於本人經驗有限,嘴皮子不溜,所以學術性,概念性,底層性的知識點暫時不做介紹。文章中有錯誤之處,歡迎拍磚和指點。特別感謝"java1234

Opencv常見用法常見錯誤(一)

一. 讀取中文的路徑的影象 使用Opencv錯誤的讀法如下: int main() { Mat img = imread("E:\示例圖片/1.jpg"); namedWindow("例項"); imshow("例項",img); w

Git的一些常見操作問題

git使用文件 1. git倉庫區域關係 工作區指的是我們平常使用得分存放工作檔案的檔案位置區域,也就是檔案管理器肉眼可見的位置 版本庫位於工作區域根目錄下的一個隱藏目錄.git目錄內 stage區也叫暫存區,位於.git/index檔案,他是一個

Java網絡編程Socket服務端客戶端

rgs .net aio highlight 如果 org author oid try Socket 編程大家都不陌生,Java 學習中必學的部分,也是 Java網絡編程核心內容之一。Java 網絡編程又包括 TCP、UDP,URL 等模塊。TCP 對應 Socket