0Celestine
0Celestine

Reputation: 81

How can I run a .html file directly from a Private repository in Github?

I'm embarrassingly new to git and GitHub and I've been trying to figure out how to run this index.html file from a private repository I've been given access to but isn't mine. I've looked at htmlpreview and rawgit, but those appear to only work for public repositories.

Any suggestions, instructions, and advice would be very gratefully received!

EDIT: I figured it out. First, clone the the repository locally. I did this by running "git clone https://github.com/{user}/{repository name}.git" in command line (might have to confirm username and password). And then in a browser, go to file:///Users/ and click through to get to the index.html file and just click it. Not very technical sounding, but it works! Hope this helps other beginners!

Upvotes: 6

Views: 7271

Answers (2)

TrisMan
TrisMan

Reputation: 1

Actually, it does seems to be possible with htmlpreview.github.io. A solution found in the following answer:

Your raw link should include a token by default after clicking "Raw" on GitHub.

So using the link with the token added and appended to htmlpreview.github.io did the trick for me. To summarize the steps:

  • visit your page (index.html) on Github.
  • click the raw button and copy the link currently in the search bar of your browser (you see it ends in ...token=XXXXXX).
  • prepend that link with https://htmlpreview.github.io/?, which will give you: https://htmlpreview.github.io/?_the_link_you_just_copied_

Upvotes: 0

Vy Do
Vy Do

Reputation: 52646

GitHub doesn't support HTML preview officially. You also shouldn't do that. Clone repository to Local PC, then view HTML file(s) on browser.

(Non-official, You can use: http://rawgit.com/ or http://htmlpreview.github.io/ )

Upvotes: 4

Related Questions