unable to chdir or not a git archive
I'm trying to setup my first git server and I'm having problems cloning to my local machine.
On the server I have done the following
cd /var/www/html/
mkdir my-first-repo
cd my-first-repo
touch file1.txt
git init
Initialized empty Git repository in /var/www/html/my-first-repo/.git/
Then on my local machine if I enter the following
git clone root@myserver:my-first-repo/.git
I get the following error messages
fatal:开发者_JAVA百科 'my-first-repo/.git': unable to chdir or not a git archive
fatal: The remote end hung up unexpectedly
root has ssh access so I was expecting it to work fine.
Any suggestions on how to fix this would be great?
Thanks
Don't add .git
i.e. do it like this:
git clone root@myserver:my-first-repo
EDIT: Wait... you created repo on HTTP server and try to access it via SSH. This is bad idea, but this should work then:
git clone root@myserver:/var/www/html/my-first-repo
The myserver:my-first-repo
directs you to $HOME/my-first-repo
.
精彩评论