gitlab.starobserve.com‘s password公钥问题
发布日期:2021-05-08 02:03:46 浏览次数:20 分类:精选文章

本文共 922 字,大约阅读时间需要 3 分钟。

当时在学校机房创建的项目,后来在在自己电脑上提交 就老是 在命令 git push -u origin master卡住 不上去

附加 提交命令如下cd existing_foldergit initgit remote add origin git@gitlab.starobserve.com:android_ui_cs_56/something.gitgit add .git commit -m "Initial commit"git push -u origin master

git push 出现SSH警告 :

The authenticity of host ‘github.com (xx.xx.xx.xx)’ can’t be established.

输入yes之后

继而出现gitlab.starobserve.com's password 提示需要输入什么认证密码的

Please make sure you have the correct access rights and the repository

exist

才发现是公钥出现了问题,要先设置用户和邮箱再重新生成ssh公钥即可。

在这里插入图片描述
解决步骤

1.要重新生成公钥,所以先删除.ssh文件夹(c:/user/.ssh),手动删除就好

2.gitbash 输入命令

2.1设置信息

git config --global user.name “yourname” git config --global

user.email “your@email.com”

//yourname是 gitlab的用户名,your@email是gitlab的邮箱

2.2.紧接着生成ssh

ssh-keygen -t rsa -C “your@email.com”(输入自己的邮箱)

后面出现的直接回车就可以

3.查看公钥

在c:/user/.ssh找到ssh文件夹
用记事本打开id_rsa.pub,复制全部内容

点击右上角头像进入setting->左边菜单栏点击 ssh keys

在这里插入图片描述

紧接着 在your ssh key会有 多出一个新的ssh!!
接着push上去就可以顺利了!

上一篇:关于git提交各种情况
下一篇:一图了解范式判断

发表评论

最新留言

初次前来,多多关照!
[***.217.46.12]2025年03月30日 16时05分44秒