使用github搭建个人网站
首先注册一个账号
然后新建一个仓库。点击New repository
名称使用 你的名字.github.io
之后在打开设置Setting
拉到下面有一个git 博客,点击它的选择主题,然后用它的模板创建一个。
创建了以后,就不会出现网上说的访问git博客出现404错误。
然后需要把自己的网站上传到github上。
先把网上仓库克隆到本地
使用cmd cd进入你需要的目录
git clone 加上你的github仓库地址
之后会在目录下生成一个文件夹,名字为网址。
进入这个文件夹,将你的网站放进去。
使用cmd进入这个目录,
输入git命令
git add . //这里有个点,代表将所有文件提交
git commit -m "注释"
git push origin master //push到主分支
//然后会提示输入账号密码
提交完成之后就可以访问你的网站。
另外你也可以购买域名解析到你的ip地址,ip可以使用ping命令得到。
上次出现
*** Please tell me who you are.
Run
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
to set your account's default identity.
Omit --global to set the identity only in this repository.
fatal: unable to auto-detect email address
使用即可
git config --global user.email "a360316515@163.com"