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

General Discussion Putting a Project on GitHub

Kevin Thomas
Kevin Thomas
1,294 Points

GitHub add repository ERROR with Dave McFarland's "my site" folder.

I've opened a GitHub account, I've downloaded their software, I've logged in, I've downloaded Dave's "my site" folder onto my desktop and I'm able to open the index.html file without issue. When I attempt to add this folder to the Git repository, I get an error message that states:

This directory does not appear to be a Git repository.  Would you like to create a repository here instead?

Attempting to do that also fails. I can't move forward with Dave's lesson without resolving this and I don't understand what's happening. All help is greatly appreciated. Thanks!

3 Answers

Chris Shaw
Chris Shaw
26,676 Points

Hi Kevin,

Before you can add files to a git repository, you first need to initialize it as one which you can do by running the below command in the root of your project folder.

git init

After that, you can add a remote origin to your GitHub repository and commit your files. See the URL below which has instructions on how to complete the entire setup process.

https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/

I also recommend if you haven't go through the Git Basics and GitHub Basics courses.

Hope that helps.

Kevin Thomas
Kevin Thomas
1,294 Points

Chris, Thank you very much!!! I'll follow the instructions on the link you provided.

Kevin Thomas
Kevin Thomas
1,294 Points

Dale, thank you very much!!! I appreciate your help.

Kevin Thomas
Kevin Thomas
1,294 Points

Ultimately, dragging and dropping Dave's folder into the Git Hub screen a few times made it accept the files. I really have no explanation, but I'm able to move forward now. Thanks again.