I've read the guide, which tells you to do the following:
- create a .github.com repository
- check it out to
path/to/repo
- cd /path/to/repo
- git symbolic-ref HEAD refs/heads/gh-pages
- rm .git/index
- git clean -fdx
- echo "My GitHub Page" > index.html
- git add .
- git commit -a -m "First pages commit"
- git push origin gh-pages
I've done that. And the page shows up. Then I moved to a different computer and checked out the repository again. Now I have a "master
" branch in my local, but no "gh-pages
." And following steps 3-6 above leaves me with no files in that branch. How do I get the files from "master
" into the branch that will publish to GitHub?
I tried git checkout master && git push origin gh-pages
but that yields
error: src refspec gh-pages does not match any.
fatal: The remote end hung up unexpectedly
error: failed to push to '[email protected]:<me>/<me>.github.com.git'