配置用户名和邮箱

实际上只是标识而已,写什么都行

SHELL
git config --global user.name "ChaimEvans"  # 用户名标识
git config --global user.email "xmldxlq@outlook.com"  # 邮箱标识
点击展开查看更多

生成SSH Key

-C 选项用于为生成的密钥对添加一个新的注释(comment)。这个注释通常用于标识密钥的用途、所有者或其他相关信息,以便于管理和识别。注释信息会存储在公钥文件中,但不会影响密钥的功能或安全性。

SHELL
ssh-keygen -t rsa -C "nas-ubuntu@github"
点击展开查看更多

在GitHub中添加公钥

~/.ssh/id_rsa.pub 的文件内容添加到 Github -> Settings -> SSH and GPG keys -> Add new SSH Key

测试连接

SHELL
ssh -T git@github.com
点击展开查看更多

输出 Hi ChaimEvans! You've successfully authenticated, but GitHub does not provide shell access. 即为成功

拉取仓库

SHELL
git clone git@github.com:ChaimEvans/xxx.git
点击展开查看更多

版权声明

作者: Chaim

链接: https://chaim.eu.org/posts/git%E9%85%8D%E7%BD%AE%E8%BF%9E%E6%8E%A5github/

许可证: CC BY-NC-SA 4.0

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. Please attribute the source, use non-commercially, and maintain the same license.

开始搜索

输入关键词搜索文章内容

↑↓
ESC
⌘K 快捷键