1. 程式人生 > >git clone報錯 "Could not read from remote repository..Please make sure you have the correct access

git clone報錯 "Could not read from remote repository..Please make sure you have the correct access

1.下載git,使用命令:

yum install git

2.配置git:

1 git config --global user.name "Your Name"
2 git config --global user.email "[email protected]"
3 #檢視配置是否生效
4 git config --list

3.建立本地倉庫:

1 #建立目錄
2 mkdir gitspace
3 cd gitspace
4 git init

4.克隆程式碼

git clone 地址

報錯:”Could not read from remote repository.Please make sure you have the correct access rights.”

執行下面指令

ssh-keygen -t rsa -C "[email protected]"

your_email是你的gitlab或者github上的email

一直回車

預設存在/root/.ssh/id_rsa.pub

cat ~/.ssh/id_rsa.pub

複製貼上到gitlab上即可