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

Learning Resources

Nick Huemmer
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Nick Huemmer
Front End Web Development Techdegree Graduate 26,840 Points

I receive the message: " fatal: Not a git repository..."

I'm currently working in the Pushing Commits to GitHub section and when I attempt to git remote add origin https://github.com/ElDuke717/medals.git I receive the following message:

fatal: Not a git repository (or any parent up to mount point /home/treehouse/workspace) Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).

I'm not sure what this means or how to ameliorate it.

1 Answer

Jonathan Grieve
MOD
Jonathan Grieve
Treehouse Moderator 91,253 Points

You just need to go into the root folder in your terminal and type the words "git init". That will create the files you need to use Version Control with your project.

Nick Huemmer
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Nick Huemmer
Front End Web Development Techdegree Graduate 26,840 Points

Ok, that worked, but I received another message that confused me. When I attempt git push -u origin master I get the message: error: src refspec master does not match any. error failed to push some refs to 'https://github.com/ElDuke717/medals.git'

Of course, I have no idea what this means, perhaps the workspace is unable to connect with the repo I set up? I don't think I'm going to fiddle with this too much more as it's not essential that I'm able to use Github with the workspaces but do need to figure out how to use the CLI with GitHub from my Windows machine, which I still have to figure out.

Thanks for your help!

Jonathan Grieve
Jonathan Grieve
Treehouse Moderator 91,253 Points

Hi Nick! :)

2 things come to mind here. The first is that you need to either Create the repository on GitHub unless you've been supplied one for the course already or link your local repository on your workspace to the remote repository.

To link your master branch in your local repository to the master branch in the remote repository you use a command like this

git remote add origin <url of remote repository>

You then make sure your commits are added to the staging area and then saved i.e. committed

then you use

git push -u origin master

Which can later be shortened even further to git push.

As a further tip you can use GitHub to create a completely blank remote reporistory with no readme file. GitHub will then guide you with all the commands you need to get going with Git on the command line.

Good luck! :-)