I'm trying to work with Git and some problems arise, the scheme is as follows:
I have two PCs in my house, one I want as a server, to host my projects and the other I want to clone these projects. The problem arises when cloning. The two PCs have Linux and created the users git
and their emails.
The PC acting as server has a repository created in the following path:
var/www/html/carpeta_del_proyecto/repositorio.git
And from the client PC I want to clone it. I have read that there are several access methods like git
, ssh
and 'http.
I have generated the keys ssh
from the client and the server, and the key ssh
public of my client I have already added it to the file /.ssh/authorized_keys
of my server.
What am I doing wrong that I can not clone? I tried the following commands:
git clone git@ip_local_servidor/usuario_servidor/ruta_del_repo/repositorio.git
git clone git@ip_pública_servidor/usuario_servidor/ruta_del_repo/repositorio.git
git clone ssh://usuario_servidor@ip_pública_servidor/ruta_del_repo/repositorio.git
git clone http://ip_pública_servidor/usuario_servidor/ruta_del_repo/repositorio.git
git clone+ssh://usuario_servidor/ruta_del_repo/repositorio.git
The last one (number 5) I'm not sure, just copy it from the internet and edit the user and the route, but the header clone+ssh
is not if it is left like this or refers to something else.
I would appreciate it if you can help me and respond, I am trying this for weeks and I can not achieve it. Thank you very much already.
Pd: I have tried with different IPs
, the local one that is given by my router, and the public one when I connect to the internet. Example 1 and 2 are the same only have different IPs
.