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上即可

猜你喜欢

转载自blog.csdn.net/lxq_9532/article/details/82255185