gitpage-push

查看远程分支

1
git branch -va

切换远程分支

1
2
git checkout -t origin/2.0.0
git checkout -t origin/gh-pages

发布静态网页

add -> commit -> push
这里要注意一下,我是直接新建的库,然后发布的,所以,没有master分支,只有gh-pages分支,github只会将你的gh-pages分支部署上去,不会动你的其他分支的东西。所以,我们要将改动提交到gh-pages分支上,再push。

1
2
3
4
myindex$ git branch
* gh-pages
myindex$ git commit -a -m "first commit"
myindex$ git push origin gh-pages

总结
github创建静态页面发布静态页面

1
2
3
4
5
6
7
8
1查看远程分支
git branch -va
2切换远程分支
git checkout -t origin/gh-pages
3发布静态网页
add -> commit -> push

步骤

1
2
3
4
5
6
7
8
9
1查看当前分支
git branch
* gh-pages
2添加文件到库中
git commit -a -m "first commit"
3提交代码到远程分支
git push origin gh-pages

git 提交代码步骤

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
创建文件夹
git init
git add README.md
git remote add origin
https://git.coding.net/BlankCat/elephant-blog-api.git
git push -u origin master
第二次
git add *
git commit -m “zjf”
git push
`

参考链接