1、申请github账号:
网址:www.github.com
申请成功以后需要到邮箱激活后才能使用(如果收不到可以到邮箱拦截里面看看)
安装git
2、上传时的准备工作
(1)本地生成一个秘钥
右键打开Git Bash Here

然后输入命名:ssh-keygen -t rsa -C “xxx@xxx.com”(邮箱必须是你注册的邮箱)
然后一路回车,默认就行->window系统去
然后到C盘,当前用户列表(User)里面找到.ssh文件夹,里面有两个文件:
id_rsa 私有秘钥(千万不能给别人)只能用记事本打开
id_rsa.pub 共有秘钥 (这个是需要的)
(2)把秘钥放到github
头像 -> settings -> SSH and GPG keys -> 粘贴进去 -> new SSH Key
(3)配置一下我是谁
鼠标点击桌面,点击右键打开Git Bash Here
it config-l查看所有信息
git config -–global user.name 'github用户名'
git config -–global user.email '必须是你的注册邮箱'
(4)本地代码扔到github上:
第一次跟github建立关系:
git remote add origin '文件链接地址'
文件链接地址:

新建一个文件,按照以下步骤在git中进行:

第一次以后只需要:
git clone http地址(先将github中的仓库克隆下来) -> git add (加点为全部上传)-> git commit -m ‘随便写’-> git push (上传到github仓库)
3、个人博客搭建
创建一个仓库:必须是github用户名.github.com
Eg:youfrweb.github.com
本仓库里面->settings-> Launch automatic page generator->continue to layout ->publish page
查看生成的个人站地址:刚刚新建的youfrweb.github.com仓库->settings->找到这个就点击就可以,或者直接输入到浏览器。(这个地址以后就是你的个人站地址了。。。开源的哦!!!)

可以将这个克隆下来,然后里面的文件可以更改、上传(步骤在上面)。
网友评论