Fatal: '/git_repos/tools.git' does not app

2019-08-04 17:23发布

问题:

I'm developing on a local windows machine and have a git repository I'd like to push to my remote dev server (mysite.com) via ssh but I keep receiving this error:

fatal: '/git_repos/tools.git' does not appear to be a git repository

fatal: Could not read from remote repository.

To clarify, I have created a folder on my remote server (git_repos/tools.git), and set up a new repo within it:

git init --bare

The folder is owned by "user" and user has full access privileges. I have then added the remote location to my local repo :

git remote add origin ssh://user@mysite.com:/git_repos/tools.git

and attempted to push the master branch up, using:

git push -u origin master

however I always encounter the above error. I am able to log in via SSH through putty, although I always land in the user root directory and not the "git_repos/tools.git" subfolder.

Has anyone encountered this issue before? Is there something I'm doing wrong?