日本免费高清视频-国产福利视频导航-黄色在线播放国产-天天操天天操天天操天天操|www.shdianci.com

學無先后,達者為師

網站首頁 編程語言 正文

Gitee:使用ssh提交代碼卻提示:DeployKey does not support push code fatal: Could not read from remote repository

作者:Trine_cui 更新時間: 2022-07-21 編程語言

文章目錄

錯誤描述
錯誤原因:沒有注冊ssh公鑰
解決辦法:
1、生成對應本地倉庫的ssh公鑰
2、獲取對應本地倉庫的ssh公鑰值
3、將得到的ssh公鑰復制,將其添加到我們的遠程倉庫gitee的SSH公鑰上去
再來從本地倉庫向遠程倉庫傳值

錯誤描述

用Git從本地倉庫上傳服務器倉庫報錯:DeployKey does not support push code
??在這里插入圖片描述
??錯誤代碼:(通過$ git push origin master命令從本地倉庫上傳到服務器倉庫)

$ git push origin master
Access deined: DeployKey does not support push code
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
錯誤原因:沒有注冊ssh公鑰

解決辦法:

添加ssh公鑰:

  1. 生成對應本地倉庫的ssh公鑰
    1.1 選擇你要上傳代碼的文件夾鼠標右鍵打開Git Bash Here
    ??找到碼云的倉庫,復制SSH的地址值
1.2 **輸入命令`ssh-keygen -t rsa -C` “ssh地址值”來生成對應本地數據的ssh的key值**,然后回車,遇到(Y/N)輸入Y,其它回車就行

在這里插入圖片描述
2. 獲取對應本地倉庫的ssh公鑰值
輸入cat ~/.ssh/id_rsa.pub命令獲取ssh的key值

3. 將得到的ssh公鑰復制,將其添加到我們的遠程倉庫gitee的SSH公鑰上去
??3.1 進入碼云(gitee),將鼠標放入頭像上,進入設置
??在這里插入圖片描述
3.2 點開SSH公鑰,將我們獲取的公鑰字符串copy進去,按確定
在這里插入圖片描述
?3.3 增加SSH公鑰成功
?在這里插入圖片描述
再來從本地倉庫向遠程倉庫傳值
1、輸入git push origin master 指令,發現上傳遠程倉庫成功
2、訪問碼云遠程倉庫,發現數據已經上傳成功了

git config --global user.name "Trine"
git config --global user.email "2792007912@qq.com"
git init
git add .
git commit -m '提交的名字,方便查找'
git remote add origin SSH值
git push
git pull

原文鏈接:https://blog.csdn.net/weixin_46253682/article/details/125897811

欄目分類
最近更新