git clone localhost?

自作多情 提交于 2019-12-05 18:22:23

问题


I am not big into ubuntu, but I managed to set up git on my client and gitosis on the server which I am proud of. I added my local ssh public key to the authorized keys for gitosos and can clone, push, commit etc. Everything works fine, from my local machine to the server - back and forth.

However since the server also serves as my webserver, I simply need to connect to the server and make a "git clone git@localhost:gitproject.git" in one of my webroot folders, but it simply doesn't work.

Do I have to add the server pub key to the authorized hosts? And if so, how? Or is there any other way to do that?

Thanks


回答1:


If you have a shell on the server, just do:

$ cd /path/to/webroot/directory
$ git clone /path/to/git-repo



回答2:


what is the errormessage?

try running

git clone --verbose git@localhost:gitproject.git

to get more information



来源:https://stackoverflow.com/questions/7888379/git-clone-localhost

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!