Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

push local master *into* gh-pages branch on github

Tags:

I created a simple gh-pages branch on github and in my local repo. I used the auto page generator to create the 5 files it uses: images javascripts stylesheets index.html params.json

I pulled this to my local repo and added js-markdown-extra.js to javascripts, and edited index.html to replace the "content" section with the compiled README.md created by the markdown library.

Putting in a dummy README.md showed it to work perfectly.

I want to then simply push my local master into (not onto) the remote gh-pages branch, without modifying the 5 website files.

I haven't found a way to do this. I was told via http://oli.jp/2011/github-pages-workflow/ that this would work: git push -f origin master:gh-pages

I tried this on a test repo and it failed, resulting in a 404 (pushing the local gh-pages made for the markdown trick fixed that)

So is there a way to push master into, as a subset of, gh-pages?

Failing that, is there a simple way to merge the master into gh-pages locally without deleting the 5 website files?

I know how to "mirror" all this stuff so the 5 files would be in the repo but I'd like to avoid that clutter.

like image 429
backspaces Avatar asked Dec 05 '13 22:12

backspaces


People also ask

How do I push master to GH page?

The command suggested git push -f origin master:gh-pages will push your local master branch to the gh-pages branch.

How do I push files into GH-pages?

On the upload page, you can drag-and-drop files and folders and they will be added to the repo. Go to the root directory of your Startup website code, select everything, then drag it to the page. It is better to use drag-and-drop than to use the choose your files link to select files from your computer.


1 Answers

From what I understand, you'd have to switch to your local copy of gh-pages. Merge in master, and then push gh-pages

git checkout gh-pages
git merge master
git push origin gh-pages
like image 78
stellarhopper Avatar answered Oct 04 '22 01:10

stellarhopper