想必大家对于github并不陌生,但是有时候我们提交到github上的页面,想将静态的页面展示给别人看,所以这个时候,需要创建一个gh-pages的分支,然后利用

https://you github name.github.io/project/projectht.html      

但是咱们本地从github上git clone自己的代码的时候,默认的分支是master。但是,咱们不仅要提交到github上的master的分支,还需要提交到github上的gh-pages分支上,这个时候,怎么提交呢,,

1。本地创建gh-pages  分支  git branch -b gh-pages

2.本地切换 gh-pages分支      git checkout gh-pages

3.更新远程的gh-pages分支    git pull origin  gh-pages

4.正常的add 文件   commit文件

5最后git  push   origin gh-pages    

最后结果,完美,所提交的文件就在远程主仓库的gh-pages的分支上了,于是就可以访问静态页面啦

 

相关文章:

  • 2022-12-23
  • 2021-11-19
  • 2021-11-19
  • 2021-06-24
  • 2021-06-19
  • 2022-12-23
  • 2021-11-19
  • 2021-11-30
猜你喜欢
  • 2022-12-23
  • 2022-02-08
  • 2021-05-22
  • 2021-11-19
  • 2022-02-07
  • 2022-01-29
相关资源
相似解决方案