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!

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 trial

HTML Prototyping with Foundation for Apps Finishing the Prototype Front Matter Challenge Solution

jessica grinberg
jessica grinberg
14,117 Points

Host this project on github pages

Hi, I completed this project and I wanted to upload it on a server to put it on my portfolio.

First, I think a made a mistake by typing git checkout -b gh-pages inside this project and it commited my whole computer! I AM FREAKING OUT, how can I undo this? when I do git status it says the last commit was from 8 months ago!! PLEASE HELP!

Second, is this project even possible to upload on github pages?

Thanks for your help!

If you typed git checkout -b then it sounds like you created a new branch called gh-pages. Try typing git branch to see all of your branches. You should then be able to find the branch you had been working on again.

1 Answer

Hi Jessica,

Adding to what woodworth said, you should be fine. A basic git workflow is something like this:

  • git pull origin master # pull down latest version of remote repo
  • git checkout -b gh-pages # create a new branch and switch over to it
  • # develop your app
  • git status # see what has changed
  • git add # add changes individually or add all with git add .
  • git commit -m "Commit Title" -m "Commit description" # self explanatory
  • git push origin gh-pages # push changes up to origin (the remote repo) gh-pages (local repo branch to push)

If everything goes well, your hosted page will be viewable at

https://<username>.github.io/<repo name>

If you're uncomfortable about the committed changes, you can reset the head back a number of commits with

where n is how many commits back to reset the current branch. There's often more than one way of using git to perform a task. Take your time and read through the docs to learn what's going on; supplement this with video tutorials and blog posts - whatever you need to help understand git to the point of being able to use it.

Official docs should be your first stop to learning more about a technology:

jessica grinberg
jessica grinberg
14,117 Points

Thanks! I figured my repo couldn't be hosted because it needs to be deployed on a server and github pages can't perform this. But your workflow worked great for my other projects! thanks!