I followed this tutorial on the nanoc webpage to deploy my webpage on github. I followed these instructions
% rm -rf output
% git clone . output
% cd output
output@master% git checkout --orphan gh-pages
output@gh-pages% git rm -rf
output@gh-pages% git remote rm origin
output@gh-pages% git remote add origin repo-url
but when i want to run
nanoc
nanoc deploy
i need to change in the base directory where the nanoc.yaml file is. But when switching i also change back(?) to the main branch from the gh-pages branch. I suppose that is because of the orphan nature of the branch, but this is just wildly guessing.
and nanoc terminates with this error message
Loading site… done
Deploying via Git to branch “gh_pages” on remote “origin”…
[email protected]:name/repo_name.git
error: pathspec 'gh_pages' did not match any file(s) known to git.
Captain! We’ve been hit!
Message:
Nanoc::Deploying::Deployers::Git::Errors::BranchDoesNotExist: The branch to deploy, gh_pages, does not exist.
This is the relevant part of the nanoc.yaml file. (the rest is the unchanged standard)
deploy:
default:
kind: git
remote: [email protected]:name/repo_name.git
branch: gh_pages
Hope someone can tell me where my ship has been hit and how i can avoid this ice rock ;)
The error message was acutally quite clear:
On github i did not have the orphan branch. So after creating the branch in the output folder i pushed this branch i was able to use ´nanoc´ and ´nanoc deploy´ to automatically deploy the page.