Home > Net >  How do I clone a repository on a local Gitlab server from another computer on the network?
How do I clone a repository on a local Gitlab server from another computer on the network?

Time:02-12

As the title says, I'm trying to clone a repository (named devops) that exists on a local Gitlab server from another computer on my network.

My setup is as follows:

  • I have a Mac that is running an Ubuntu Server OS via VirtualBox (named gitlab-server). This is where I have Gitlab configured and working properly, as I am able to access the repo on the Host-only Adapter from other VirtualBox operating systems via SSH.
  • On the same network I have another computer using Ubuntu that I am trying to configure to be my deployment server (let's call this deployment-server).
  • On the deployment-server, I have added the following line to the /etc/hosts file:
    • 192.168.1.20 gitlab.test
    • That is the IP address to the gitlab-server
  • Currently, I am able to SSH into the gitlab-server from the deployment-server via the NAT network configured by VirtualBox. I set up port forwarding from external port 2222 to internal port 22.
  • An SSH key from deployment-server has been added to the Maintainer's profile (jadedInsomnia89) for the project in GitLab.

However, when I run git clone [email protected]:jadedInsomnia89/devops.git on the deployment-server, I get the following error:

Cloning into 'devops'...
ssh: connect to host gitlab.test port 22: Connection refused.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

How do I properly access the GitLab server on the gitlab-server OS? Please let me know any other details you may need.

Note: I am setting up another computer for the deployment-server because the Mac doesn't have enough RAM to simultaneously run a deployment server, Jenkins server, and a GitLab server on 3 separate virtual operating systems like the course I am currently attending does.

CodePudding user response:

You will need to add your port number.

Try this:

git clone ssh://[email protected]:2222/jadedInsomnia89/devops.git
  • Related