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 trialFarnoosh Johnson
7,887 Pointshow to start with github?
I made a html and css files on my desktop, called ** my_first_web_page**. Now I am trying to push the repository on my github account to be able to access to my files remotely. 1- I made a new repository in my github account. 2- I am using mac, via terminal I have git installed and I used $git init to make a new repository 3- everything looked set up while I was following all the steps in github course 4- I also checked my git status and it shows; ''' On branch master nothing to commit, working directory clean ''' my question is how can I connect my folder on desktop with my repository in github?
I used '''$ git remote, git clone https://github.com/farnoosh63/my_new_webpage.git ''' when I used '''$ git push ''', this message will show up:
''' fatal: No configured push destination. Either specify the URL from the command-line or configure a remote repository using
git remote add <name> <url>
and then push using the remote name
git push <name>
''' Another error: ''' $ git push origin master fatal: 'origin' does not appear to be a git repository fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists. '''
4 Answers
Micah Courey
20,168 Pointsthe git commands are
git remote add origin <url>
and to push to your github repository
git push origin master
Treehouse has a course called Git Basics if you wanna learn how to do more with git and github https://teamtreehouse.com/library/git-basics
Farnoosh Johnson
7,887 Pointsthanks, that works but I cannot see my project online in username.github.io/repository_name farnoosh63.github.io/my_new_webpage
$ git push origin gh-pages Counting objects: 16, done. Delta compression using up to 4 threads. Compressing objects: 100% (16/16), done. Writing objects: 100% (16/16), 758.20 KiB | 0 bytes/s, done. Total 16 (delta 4), reused 0 (delta 0) To https://github.com/Farnoosh63/my_new_webpage.git
- [new branch] gh-pages -> gh-pages
Farnoosh Johnson
7,887 Pointsthis is error from github site:
404
File not found
The site configured at this address does not contain the requested file.
If this is your site, make sure that the filename case matches the URL. For root URLs (like http://example.com/) you must provide an index.html file.
Read the full documentation for more information about using GitHub Pages.
Jonathan Grieve
Treehouse Moderator 91,253 PointsSo would I right in saying you have to add the repository name on the Github website before you push the files?
And now does Github prove your credentials to add the files to the correct account?