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 trialjessica grinberg
14,117 PointsHost 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!
1 Answer
Robert Richey
Courses Plus Student 16,352 PointsHi 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
- git reset --hard HEAD~n
- https://git-scm.com/docs/git-reset
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
14,117 PointsThanks! 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!
woodworth
Front End Web Development Techdegree Student 19,831 Pointswoodworth
Front End Web Development Techdegree Student 19,831 PointsIf 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.