赞
踩
执行命令git push -u origin master提交代码到git库,报错提示无法解析主机名Please make sure you have the correct access rights and the repository exists
原因:ssh key有问题,连接不上服务器
解决方案:
1、重新在git设置一下身份的名字和邮箱
git config --global user.name “yourname”
git config --global user.email“your@email.com"
注:yourname是需要设置的名字,your@email是需要设置的邮箱。
2、删除.ssh文件夹下所有文件(直接手动删除就可以了)
3、git输入命令,重新生成key
$ ssh-keygen -t rsa -C “your@email.com”(请填设置的邮箱)
页面会出现,key创建成功提示:
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/your_user_directory/.ssh/id_rsa)
直接按下回车键(Enter键),
系统会自动生成在.ssh文件下重新生成两个文件,
id_rsa和id_rsa.pub,用记事本打开id_rsa.pub
将全部的内容复制
4、打开https://gitlab.stuq.ces
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。