当前位置:   article > 正文

执行git push -u origin master,报错Please make sure you have the correct access rights and the repository_git push -u origin master 报错

git push -u origin master 报错

执行命令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

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Guff_9hys/article/detail/868794
推荐阅读
相关标签
  

闽ICP备14008679号