fatal: does not appear to be a git repository

I set up a empty git repo on my production server with

git init --bare

From my local machine i added the repo as a remote:

git remote add origin ssh://user@

If i issue following command

git remote show origin

I get an error message saying:

fatal: '~/git/example.com' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

I tried the colon as mentioned here, but it didn't help.

2

3 Answers

With SSH URLs, relative paths start from your home directory, and it doesn't understand shell shortcuts like ~. So do:

git remote add origin ssh://user@

if you want to use absolute paths, like /home/mario/git/example.com, use an extra leading slash:

git remote add origin ssh://user@
1

This means that the remote server does not have a repo at ~/git/example.com I suspect you have the address wrong. Most git addresses will be something like :project.git. Most do not have a path or a reference to ~

I have the answer to my own problem...

I am using the URL conventions used in this post

The Domain i was using was just defined in my local hosts file. Which seems to work with everything else, accept for git.

I then replaced the example.com part with the actual Server IP and got it working.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like