Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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.