Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialChristopher Mlalazi
Front End Web Development Techdegree Graduate 17,305 PointsHosting on Github pages
This video deals with a website that does not yet have a repository. What if you want to publish on Github pages one that already has a repository what are the steps?
7 Answers
Kevin Korte
28,149 PointsI believe it would be a as simple as creating a "gh-pages" branch, and putting your html, css, and js files that compose the site into that branch.
Christopher Mlalazi
Front End Web Development Techdegree Graduate 17,305 Points@Kevin no I am not still answered. My questions arises from this scenario. Following the steps in this video, I created an online repository on Github which I went on to have hosted on pages. But what I notice now is that the very same folder is not in my desktop Github, and if I try to load it as a new repository there, I get an alert which says that particular repository exists in Github - yes I know it exists on the online Github, but it is not being reflected on my desktop app. Is it necesarry for me to have this folder in the desktop Github in this case? Because I am thinking, what if I want to commit some new changes how do I do it?
Christopher Mlalazi
Front End Web Development Techdegree Graduate 17,305 Pointsrom one challenge to another. I must be thick. Now how do I make changes to the code in the Github pages website. I have tried to go back to my code on my desktop and made a change, but how do I commit that now and make it be visible in the website? I am suspecting it must be through command line, but I might as well be trying to read hieroglyphics there.
Kevin Korte
28,149 PointsSo I'm not familiar with the videos at this time, but in general, if the repo already exists on github, than you need to clone the repo to your local machine. That will give you your own working copy, and make the connection between your local repo and the remote repo on github. Than when you wanted to make changes, you make the changes the to your local copy first, and than you push those changes to the remote repo, where they would than be reflected online. You would just have to make sure you where pushing to the gh-pages branch.
Christopher Mlalazi
Front End Web Development Techdegree Graduate 17,305 PointsThat makes sense, and how do I push is it via the command line?
Kevin Korte
28,149 Pointsso to push your gh-pages branch to your remote gh-pages branch so it would be live on the internet, you'd first want to make sure you are on your local gh-pages branch, by going git checkout gh-pages
, and than push it, so git push origin gh-pages
should do the trick.
Christopher Mlalazi
Front End Web Development Techdegree Graduate 17,305 PointsThanks Kevin let me try it will give you feedback
Christopher Mlalazi
Front End Web Development Techdegree Graduate 17,305 PointsChristopher Mlalazi
Front End Web Development Techdegree Graduate 17,305 PointsThanks Kevin I found a video explaining it in Treehouse.
Kevin Korte
28,149 PointsKevin Korte
28,149 PointsPerfect!