Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm trying to add a remote server from my git bash prompt with something like:

git remote add origin ssh://myserver.pair.com/usr/home/myname/myrepo.git

fatal: Not a git repository (or any of the parent directories): .git

I seem to have ssh set up ok because this...

ssh myserver.pair.com

... logs in just fine without prompting me for my password.

What appears to happen with the remote add is that it doesn't even try to contact the server. It returns with an error instantly, and it doesn't appear to matter what I put for a server name:

git remote add origin ssh://blahblahblah/usr/home/myname/myrepo.git

fatal: Not a git repository (or any of the parent directories): .git

Have I misconfigured git somehow?

Technical details: Windows Vista, MsysGit v1.6.4, SSH configured with the file C:\Program Files\Git\etc\ssh\ssh_config

share|improve this question

1 Answer 1

up vote 16 down vote accepted

fatal: Not a git repository (or any of the parent directories): .git

This tells you that the directory you're in is not a git repository. Before you can add remote servers, commit things and so you must have a git repository created.

In a git repository there's a directory (which can be hidden) named .git. It contains metadata on the repository and all the data regarding the checked files.

To create it type git init in the directory you wish to have a git repository. Then you could add remote servers and perform operations on it.

share|improve this answer
    
Thanks :) I actually solved this with a git clone first. +1 –  izb Nov 16 '09 at 12:07

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.