There is a machine with dedicated IP. It is necessary to create a repository on it and connect from other machines.

There is git init - everything is clear with this, and git clone - if you work with a gitkhab with it, everything is also clear, use the repo URL, and go ahead.

What to enter instead of repo URL in my case?

  • You would first choose the protocol, by which you intend to connect to the remote machine :) - D-side
  • @ D-side, SSH, I think. - Ssss

1 answer 1

example.

on the server (accessible from the outside by the name server.tld ) you create a bare repository in the repo directory in the user home directory on behalf of this user:

 $ git init --bare ~/repo 

from another machine you clone this repository:

 $ git clone ssh://user@server.tld/~user/repo 

here ~user/repo is the path to the repository on the server, the string ~user means the home directory of the user user .

another way to specify url :

 $ git clone user@server.tld:repo 

A more convenient means of creating, managing, and using a set of git repositories seems to me to use a set of gitolite scripts. the package of the same name is present in most popular distributions of the gnu / linux operating system.

  • I think this is the twentieth time when you talk about bare-repositories) - Nick Volynkin
  • @NickVolynkin, the search suggests that there is only one more answer than you (9 and 8, respectively). - aleksandr barakin
  • Yes, a popular topic)) - Nick Volynkin