git创建 gh-pages , github pages


  1. 创建 gh-pages 分支

    vue-example  ‹master› $ git branch -m master gh-pages

    或者使用下面命令:

    $ git branch gh-pages
    $ git checkout gh-pages
    切换到分支 'gh-pages'
  2. 删除 分支内容

    vue-example  ‹gh-pages› $ git rm -rf .
    rm '.babelrc'
    rm '.editorconfig'
    rm '.eslintrc.js'
  3. 添加文件内容

  4. 添加提交内容, 提交

    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
  5. 提交到远程库

    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
  6. 提交成功, 打开链接即可访问. http://itaken.github.io/vue-example/


参考文档


Author: Itaken
Reprint policy: All articles in this blog are used except for special statements CC BY 4.0 reprint polocy. If reproduced, please indicate source Itaken !
  TOC目录