创建
gh-pages
分支vue-example ‹master› $ git branch -m master gh-pages
或者使用下面命令:
$ git branch gh-pages $ git checkout gh-pages 切换到分支 'gh-pages'
删除 分支内容
vue-example ‹gh-pages› $ git rm -rf . rm '.babelrc' rm '.editorconfig' rm '.eslintrc.js'
添加文件内容
添加提交内容, 提交
vue-example ‹gh-pages*› $ git add . vue-example ‹gh-pages*› $ git commit -a -m "添加demo" [gh-pages 380c33e] 添加demo 48 files changed, 99 insertions(+), 2125 deletions(-) delete mode 100755 .babelrc delete mode 100755 .editorconfig delete mode 100755 .eslintrc.js
提交到远程库
vue-example ‹gh-pages*› $ git push origin gh-pages Username for 'https://github.com': itaken Password for 'https://itaken@github.com': 对象计数中: 23, 完成. Delta compression using up to 4 threads. 压缩对象中: 100% (23/23), 完成. 写入对象中: 100% (23/23), 1.27 MiB | 334.00 KiB/s, 完成. Total 23 (delta 1), reused 0 (delta 0) remote: Resolving deltas: 100% (1/1), done. To https://github.com/itaken/vue-example.git * [new branch] gh-pages -> gh-pages
提交成功, 打开链接即可访问. http://itaken.github.io/vue-example/