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 trial

PHP

daniwao
daniwao
13,125 Points

Pushing to GitHub through PHP

My question is that I'm trying to push the files within the HTDOC's into GitHub. I use a Mac so I usually just use my terminal and then push through Git. I can't seem to "get into" the HTDOC's folder though so I'm not sure how to push it into Git.

Any suggestions?

3 Answers

Stone Preston
Stone Preston
42,016 Points

do you have a repo set up inside that folder? if your having trouble navigating to the folder in terminal just open up finder and navigate to the folder. then type cd and a space on the command line and drag the folder name from the top of finder into the terminal window. it will paste the folder path right after the word cd. press enter and you will be inside the htdocs directory

Stone Preston
Stone Preston
42,016 Points

yes you want to use git init from the directory where your root of the site is located. so if your site is located in /MAMP/htdocs/ then use git init there.

daniwao
daniwao
13,125 Points

Thank you Stone Preston , just to clarify, now when I dragged the folder that I made, it says /Applications/MAMP/htdocs/file_name

Is that correct? And then start the git init from there on my terminal.