Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

git remote add origin ssh://

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

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


... 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
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


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.