美文网首页
ubuntu同步github仓库

ubuntu同步github仓库

作者: cws | 来源:发表于2016-07-12 18:08 被阅读122次

1、安装hugo和git

2、生成密钥,将密钥添加到github

cd ~
ssh-keygen -t rsa -C "123456@qq.com"
cd ~/.ssh/
vim id_rsa.pub

3、配置本地用户和邮箱

git config - -global user.name "reber-9"
git config - -global user.email "123456@qq.com"

4、验证密钥是否添加成功

ssh -T git@github.com

5、克隆远程工程

git clone https://github.com/reber-9/reber-9.com.git

6、添加CNAME

cd ~/reber-9.com/
echo "reber-9.com" >> static/CNAME

7、更新

更新origin remote的master分支:
git pull origin master
获取服务端的改动:
git fetch

8、生成html文档,然后创建分支,进行同步

hugo
cd public/
git init
git checkout - -orphan gh-pages
git remote add origin git@github.com:reber-9/reber-9.com.git
git pull origin gh-pages

9、添加文件然后上传

git add .
git commit -m "add html"
git push origin gh-pages

相关文章

网友评论

      本文标题:ubuntu同步github仓库

      本文链接:https://www.haomeiwen.com/subject/bicsjttx.html