Sarath
Sarath

Reputation: 9156

How pages works in Git on different branchs?

I have two branches in my repository(SAMPLE)

  1. master .. under Master ---> AA (folder)--> A.html

  2. gh-pages.. under gh-pages ---> BB (folder) --> B.html

I have make master as my default.

If my user name is USER ,then i got USER.github.com/SAMPLE/BB/B.html -- it works fine and I can see my page live.

So how can i view the master pages. like (USER.github.com/SAMPLE/AA/A.html)

Upvotes: 0

Views: 113

Answers (2)

Mark Longair
Mark Longair

Reputation: 467581

The gh-pages branch is special, and the only branch that is mapped to your USER.github.com/SAMPLE web space. If you want other files to appear in your gh-pages branch, you'll need to explain more about what you're trying to do for other people to be able to make good suggestions about how to do that. For example:

  • are these generated files that you're publishing there, like automatically generated documentation?
  • is your master branch just the pages that you want to display anyway?

etc. etc.

Upvotes: 2

lprsd
lprsd

Reputation: 87145

Just merge the master branch into the gh-pages branch.

git checkout gh-pages
git merge master
git commit -m 'Added AA folder from the master to be available via the web-page'
git push origin gh-pages

Upvotes: 0

Related Questions