链接你的GITHUB!

使用邮箱注册 GitHub 账户,选择免费账户(Free),并完成邮件验证。

右键 -> Git Bash Here

设置用户名和邮箱

1
2
git config --global user.name "GitHub 用户名"
git config --global user.email "GitHub 邮箱"

例如我的:

1
2
git config --global user.name shanyang
git config --global user.email 87347283595@qq.com

创建 SSH 密匙

输入 ssh-keygen -t rsa -C "GitHub 邮箱",然后一路回车。

添加密匙:

进入 [C:\Users\用户名 \.ssh] 目录(要勾选显示“隐藏的项目”),用记事本打开公钥 id_rsa.pub 文件并复制里面的内容。

登陆 GitHub ,进入 Settings 页面,选择左边栏的 SSH and GPG keys,点击 New SSH key。

SSHKEY

Title 随便取个名字,粘贴复制的 id_rsa.pub 内容到 Key 中,点击 Add SSH key 完成添加。

微信截图_20250413201702.png

验证连接:

打开 Git Bash,输入 ssh -T git@github.com 出现 “Are you sure……”,输入 yes 回车确认。

显示 “Hi xxx! You’ve successfully……” 即连接成功。

3. 创建 Github Pages 仓库

GitHub 主页右上角加号 -> New repository:

  • Repository name 中输入 用户名.github.io
  • 勾选 “Initialize this repository with a README”
  • Description 选填

填好后点击 Create repository 创建。

微信截图_20250413201817.png

创建后默认自动启用 HTTPS,博客地址为:https://用户名.github.io