-
Set up the repository : PUBLIC & initialize the repository with a readme file
-
Clone it and navigate to the repository folder
$ git clone https://github.com/user/repository
$ cd repository/
- Create a special GitHub Pages branch and switch and Remove all files from the old working tree
$ git checkout --orphan gh-pages // Create new branch "gh-pages"
$ git rm -rf . // [don't forget the dot at the end!] Remove all files in folder
- Add content and push
$ echo "readme file" > readme.md
$ git add readme.md
$ git commit -a -m "readme file commit"
$ git push origin gh-pages
-
Make the gh-pages branch your default branch on GitHub. Repository Administration > Options > Set “Default Branch” setting to something other than master
-
Delete the master branch on GitHub (which I think just sends a null branch to replace the remote master branch)
$ git push origin :master
- Delete the master branch in your local repo (once you’ve checked everything is working!)
$ git branch -d master
$ git branch -D master // -D in case of force
- Initialize a Harp app
$ harp init _harp // Init standard harp app
- Work on your project
// $ cd _harp/
// $ harp server
- Compile your Harp app
$ harp compile _harp/ ./ // Compile harp app
- Deploy to GitHub Pages
// git add -A // Git add changed files
// git commit -a -m "Harp + Pages commit" // Commit Git changes
// git push origin gh-pages // Git push changes to repository
- Load your new GitHub Pages site. Your page can be found at:
// your-github-name.github.io/repository-name
more :
- https://powderkeglabs.com/blog/harpjs-and-github-pages.html
- http://oli.jp/2011/github-pages-workflow/#deleting-master
-
Remove the
dist
directory from the project’s.gitignore
if needed. -
Make sure git knows about your subtree (the subfolder with your site).
git add dist && git commit -m "Initial dist subtree commit"
- Use subtree push to send it to the gh-pages branch on GitHub.
git subtree push --prefix dist origin gh-pages