返回
Featured image of post gitee仓库的第一次推送遇见的错误

gitee仓库的第一次推送遇见的错误

记录gitee第一次推送出现错误的解决方法,网上查完文章,这里糅合到一起。

推送失败,gitee仓库缺少公钥

1
git push origin lsk_dev
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
The authenticity of host 'gitee.com (180.76.198.77)' can't be established.
ED25519 key fingerprint is SHA256:+ULzij2u99B9eWYFTw1Q4ErYG/aepHLbu96PAUCoV88.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? y
Please type 'yes', 'no' or the fingerprint: yes
Warning: Permanently added 'gitee.com' (ED25519) to the list of known hosts.
git@gitee.com: Permission denied (publickey).
fatal: Could not read from remote repository.

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

检查与自己gitee仓库连接失败,没有显示hellow

1
ssh -T git@gitee.com
1
git@gitee.com: Permission denied (publickey).

进行公钥配置

1
ssh-keygen -t rsa -C "14062626+linsk27@user.noreply.gitee.com"
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
Generating public/private rsa key pair.
Enter file in which to save the key (C:\Users\lsk69/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in C:\Users\lsk69/.ssh/id_rsa
Your public key has been saved in C:\Users\lsk69/.ssh/id_rsa.pub
The key fingerprint is:
SHA256:SOV+Ur+E321Pw+9NL77mSgZm6V8lc+W3LJi3rN5qXG8 14062626+linsk27@user.noreply.gitee.com
The key's randomart image is:
+---[RSA 3072]----+
|        .        |
|       o         |
|      . . .     .|
|     . o . +   ..|
|      . S B o o =|
|         * +o+o*o|
|          oo*o+==|
|           *+.=E*|
|          o+=O=+*|
+----[SHA256]-----+

获取公钥失败

1
 ssh-agent -s
1
2
3
4
5
6
7
8
unable to start ssh-agent service, error :1058

> Fix Error **unable to start ssh-agent service, error: 1058(xxxx)**
>
> 1. win + R, Go To `services.msc`
>
> 2. Find And Check Is `OpenSSH Authentication Agent` Service Running
> 

再次运行公钥获取成功,连接成功

1
2
3
ssh-agent -s

ssh -T git@gitee.com
1
Hi linsk27(@linsk27)! You've successfully authenticated, but GITEE.COM does not provide shell access.

复制公钥数据到gitee仓库的公钥(设置)

把ssh密钥添加到码云

打开C盘–>用户–>你的用户名–>找到.ssh文件夹。找到id_rsa.pub(日过有多个用最新的那个),用记事本打开,复制整个文本粘贴到gitee(点头像,进入gitee设置面板,SSH设置,将复制的文本粘贴到公钥,标题会自动生成,然后点击添加,根据提示输入密码就可以了。)

重新推送成功

1
git push origin lsk_dev
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
Enumerating objects: 16, done.
Counting objects: 100% (16/16), done.
Delta compression using up to 16 threads
Compressing objects: 100% (15/15), done.
Writing objects: 100% (16/16), 2.19 KiB | 2.19 MiB/s, done.
Total 16 (delta 0), reused 0 (delta 0), pack-reused 0 (from 0)
remote: Powered by GITEE.COM [1.1.5]
remote: Set trace flag 824c4db5
remote: Create a pull request for 'lsk_dev' on Gitee by visiting:
remote: https://gitee.com/larrry/competition-system/pull/new/larrry:lsk_dev...larrry:main
To gitee.com:larrry/competition-system.git
 * [new branch]      lsk_dev -> lsk_dev
404_@林达所作
使用 Hugo 构建
主题 StackJimmy 设计