创建自己的github.io

1、创建GitHub账号

bash 复制代码
GitHub地址:https://github.com/
点击Sign up创建账号
如果已创建,点击Sign in登录

2、创建仓库

bash 复制代码
假设Owner为username,则Repository name为username.github.io

说明:
1、Owner为用户名
2、Repository name为仓库名,格式为:用户名.github.io

3、配置SSH-Key

3.1、生成SSH密钥

bash 复制代码
ssh-keygen -t rsa -f ~/.ssh/github_id_rsa

3.2、查看SSH公钥

bash 复制代码
cat ~/.ssh/github_id_rsa.pub

3.3、部署公钥

bash 复制代码
详见:
https://gitee.com/help/articles/4181#article-header0
https://docs.github.com/zh/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent

4、克隆项目

bash 复制代码
git clone git@github.com:username/username.github.io.git

5、创建文件

bash 复制代码
cd username.github.io
echo "Hello World" > index.html

6、提交文件

bash 复制代码
git add .
git commit -m "Initial commit"
git push -u origin main

7、浏览器访问

bash 复制代码
浏览器访问域名:username.github.io

8、配置CNAME

bash 复制代码
如果不想配置CNAME,忽略以下操作。

8.1、以阿里云域名为例,配置CNAME

8.2、给GitHub的username.github.io仓库配置自定义域名

8.3、查看GitHub的username.github.io仓库

bash 复制代码
发现仓库多了一个文件,文件名为CNAME,文件内容为自定义的域名

8.4、浏览器访问

bash 复制代码
1、访问自定义域名username.xxx.yyy
2、访问username.github.io会跳转到username.xxx.yyy

9、详见

bash 复制代码
https://pages.github.com/
https://docs.github.com/zh/pages
相关推荐
DeepAgent6 小时前
AI Agent 项目赏析:DeerFlow 2.0 —— 一个真正“长跑“的 SuperAgent 是怎么设计出来的?
github·agent
重生之我来学Python7 小时前
Docker套装的简介、安装、超级详细教程
linux·docker·容器·eureka·github
粥里有勺糖8 小时前
视野修炼-技术周刊第132期 | 一些有趣的组件
前端·github·aigc
智碳能碳管理平台8 小时前
企业能碳管理系统的月度锁账、防篡改与留痕怎么架构
架构·github·能碳管理系统·智碳能碳管理平台·企业能碳管理系统·绿色工厂申报saas·能碳管理平台
mjhcsp9 小时前
Github Copilot 新手极速上手指南
github·copilot
重生之我来学Python9 小时前
Git-SVN 混合开发,从入门到精通!
开发语言·git·svn·github
u13013010 小时前
GitHub 热榜项目:日榜(2026-09-05)
github
m4Rk_10 小时前
【论文阅读】Agent 记忆机制(61):CFGM——用粗到细的记忆落地贯通经验采集、知识蒸馏与在线纠错
论文阅读·人工智能·学习·开源·github
是2的10次方啊11 小时前
GitNexus:给 AI 代理装上代码知识图谱
github
其实防守也摸鱼12 小时前
OpenClaw 深度解析:从原理到实战的完整指南
运维·服务器·数据库·github·copilot