How to debug git' 'fatal: Could not read f

2019-08-23 05:17发布

I'm trying to setup git for the first time.

I have a VPS from Linode running Ubuntu 12.04, and my own desktop on Windows 7. I am using Git Bash on my desktop.

On my local windows machine I created a directory, used git init, added a test file, and committed it.

On the linux server, I installed git, then created the directory

/srv/git/site.git

I then used the command

/srv/git/site.git git init --bare.

Finally, back on the local windows machine, I use

git remote add mysite ssh://root@11.123.123.123/srv/git/site.git

(IP changed for security reasons).

all is well up until this point.

I finally try to push by using

git push -u mysite +master:refs/heads/master.

This command gives me the error

fatal: 'root@11.123.123.123/srv/git/site.git' does not appear to be a git repository  
fatal: Could not read from remote repository`

I've checked the IP and user name used for my SSH login, and they are right. In fact, just using PuTTY I can login using the same root@IP address.

I'm banging my head against the wall here. I would really appreciate it if someone could provide tips for debugging this. Is there a connection log where I can see the actual 'ssh' command Git Bash is executing?

Is the problem that it can't connect to the server, or the specific folder?

Does Git Bash use a different default directory than / ? Do I need a new user for git?

If it matters, I haven't yet applied any hooks. I will eventually need to use a send-receive hook from my /srv/git/site.git to the actual website HTML located in /srv/www/site.com/public_html.

标签: git web ssh
0条回答
登录 后发表回答