I created three virtual machines ,A, B, C.
The three virtual machine networks are connected to each other ,can ping pong
In A , I created a GitLab private server by docker.
I can pull and push in IDEA
But In B, I want to git clone
from A's gitlab server, and the SSH key is generated, I have put the public key on the gitlab server.
And I configured user Name and user.email.
CodePudding user response:
First, if you use an SSH key, you should use an SSH URL
git clone [email protected]:<user>/java_project.git
Second, this assumes:
- GitLab is on 192.168.56.100 the A machine
- GitLab manages (hosts) the java_project.git created under the GitLab user account
- GitLab user account SSH setting has the public key from the key pair created on B (which is hopefully what you mean by "I have put the public key on the gitlab server", because adding the public key directly on the A
~git/.ssh/authorized_keys
would not work)
You can test from B your SSH connection to GitLab A server with:
ssh -Tv [email protected]