创建自己的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
相关推荐
CSDN官方博客5 小时前
GitHub Copilot 新手极速上手指南
github·copilot
用户57844292286210 小时前
GraphRAG 与 LightRAG
github
峰向AI10 小时前
别再花几万块搭 Agent 了,[微软开源] 3500 行框架让 AI 自己练级
github
解道Jdon18 小时前
JDK 27发布:紧凑对象头、G1默认、量子安全TLS
ide·windows·git·svn·eclipse·github·visual studio
m4Rk_18 小时前
【论文阅读】Agent 记忆机制(72):EMA——在写入前决定什么值得记住
论文阅读·人工智能·学习·开源·github
OpenTiny社区18 小时前
从开发到运行:OpenTiny NEXT 如何构建 Agent 时代的 Web 应用?
前端·github·ai编程
政安晨19 小时前
政安晨【超级AI智能体~技术简报】- Skills 元方法论霸榜 + Agent Harness 爆发 + 反直觉叙事的胜利
github·开源项目·ai agent·技术简报·政安晨
QUOR19 小时前
ZorvAI APK 插件框架 · 技术架构与功能介绍
github·apk·编程语言
孙琦Ray19 小时前
Homebrew/BrewUI:Homebrew 官方出的 macOS 图形客户端,把 brew 的装包、更新包变成点选
人工智能·开源·github
HelloGitHub19 小时前
从一份 README 到 3 万星,RustFS 这一年都干了什么?
开源·github