您的位置:首页 > 教育 > 培训 > 建站最好的_erp系统操作流程图_关键词排名优化价格_百度收录排名

建站最好的_erp系统操作流程图_关键词排名优化价格_百度收录排名

2025/4/26 17:55:15 来源:https://blog.csdn.net/lyk520dtf/article/details/147504370  浏览:    关键词:建站最好的_erp系统操作流程图_关键词排名优化价格_百度收录排名
建站最好的_erp系统操作流程图_关键词排名优化价格_百度收录排名

文章目录

  • 前言
  • 一、生成 SSH 公钥
  • 二、git使用ssh拉取代码、提交
  • 问题


前言

使用记录

一、生成 SSH 公钥

参考gitee介绍:https://help.gitee.com/base/account/SSH公钥设置

Windows 用户建议使用 Windows PowerShell 或者 Git Bash,在 命令提示符 下无 cat 和 ls 命令。

1、通过命令 ssh-keygen 生成 SSH Key:

ssh-keygen -t ed25519 -C “Gitee SSH Key”

-t key 类型
-C 注释
输出,如:

Generating public/private ed25519 key pair.
Enter file in which to save the key (/home/git/.ssh/id_ed25519):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/git/.ssh/id_ed25519
Your public key has been saved in /home/git/.ssh/id_ed25519.pub
The key fingerprint is:
SHA256:ohDd0OK5WG2dx4gST/j35HjvlJlGHvihyY+Msl6IC8I Gitee SSH Key
The key's randomart image is:
+--[ED25519 256]--+
|    .o           |
|   .+oo          |
|  ...O.o +       |
|   .= * = +.     |
|  .o +..S*. +    |
|. ...o o..+* *   |
|.E. o . ..+.O    |
| . . ... o =.    |
|    ..oo. o.o    |
+----[SHA256]-----+

中间通过三次回车键确定

2、查看生成的 SSH 公钥和私钥:

ls ~/.ssh/

输出:

id_ed25519 id_ed25519.pub

私钥文件 id_ed25519
公钥文件 id_ed25519.pub
读取公钥文件 ~/.ssh/id_ed25519.pub:
cat ~/.ssh/id_ed25519.pub

输出,如:

ssh-ed25519 AAAA***5B Gitee SSH Key

复制终端输出的公钥。

粘贴到gitee ssh公钥页面,自定义标题
在这里插入图片描述

二、git使用ssh拉取代码、提交

1、先设置你的昵称,邮箱【配置过的忽略】
git config --global user.email “lyk@bahg.cn”
git config --global user.name “yink”

2、使用ssh协议才可以拉代码,https协议就是自己输入账号密码
本地配置成功后一般如下显示:
在这里插入图片描述
不同域名使用不同的ssh,如果你一个网站有两个账号,可以在针对每个项目自行设置


问题

1、如果你之前拉取代码是通过https协议拉取,是不能使用ssh提交代码,通过下面命令改成ssh协议,才能正常提交

git remote set-url origin git@gitee.com:ying_kang_liu/laravel-box.git

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com