使用git上传代码
创建公钥与github连接
1.打开Git Bash,输入以下命令,注意换成自己邮箱
$ ssh-keygen -t ed25519 -C "your_email@example.com"
2.密钥位置
当系统提示“Enter a file in which to save the key(输入要保存密钥的文件)”时,可以按 Enter 键接受默认文件位置,也可手动修改位置。
> Enter a file in which to save the key (/c/Users/YOU/.ssh/id_ALGORITHM):[Press enter]
3.一直回车后生成密钥
4.将密钥添加至github
点击进入设置
点击SSH and GPG keys
将id_ed25519.pub文件内的内容粘贴入框内
测试连接,输入以下命令
ssh -T git@github.com
连接成功后提示
Hi seekwhale13! You've successfully authenticated, but GitHub does not provide shell access.