Push only the gh-pages branch
The intent of this tip is show how to push only the gh-pages branch in GitHub. This is useful cause with gh-pages branch GitHub host a static website.
git init
git add .
git commit -m "First inclusion of files"
git branch -m master gh-pages
git remote add origin git@github.com:<USER>/<REPOSITORY>.git
git push origin gh-pages
The trick is git branch -m
after git commit
, -m
in git branch
command change the name of the branch. You can check this with git status
and push.
Note in git push
command after origin
is gh-pages
branch.
Written by Fernando A. Damião
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Gh-pages
Authors
![](https://coderwall-assets-0.s3.amazonaws.com/uploads/user/avatar/64562/2_1.jpg)
pr3ssh
6.456K
![](https://coderwall-assets-0.s3.amazonaws.com/uploads/user/avatar/45085/bd178bca43aaf1ebd472633932a19b6e.jpeg)
anasnakawa
1.675K
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#