Git - Git required on server?

I read a lot of information, but still can not understand. Suppose we have a server machine and a client machine. The client connects to the server via ssh. There is no authentication on the server on the git server. I am considering the simplest configuration - there are three clients and one server. Repo is saved on git server

Do we need to install git on the server in this case? I am confused as the git push and git clone commands are executed using git on the client side.

+5
source share
3 answers

As others have pointed out, you don’t need a “server” in the sense of “one big machine somewhere on the Internet,” but if you use git push , the machine on which you run git push is technically the client computer and the one you click on is the server during this operation.

When you run git push , Git essentially runs ssh user@server 'git-receive-pack /path/to/repo' , that is, it runs git-receive-pack on the server. Then the local git push talks to the remote git-receive-pack through an SSH connection.

In short: you need Git on the server when you click SSH. Not necessarily a complete installation, but at least an executable git-receive-pack for pushing and git-upload-pack for pulling / pulling.

You can also click on a remote computer without Git installed there using other protocols (e.g. webdav), but I would not recommend it.

+6
source

just add to the very good answers already here.

The concept of "server" is confused when it comes to git. We like to think that there is some central point where everything "lives", in our technical life we ​​believe that the server is for this. We find this idea comfortable (right or wrong)

Being a distributed system, each cloned copy of git -ball is technically a repository.

This suggests that it is still a very good idea to have some “central” management point for your repository.

Bitbucket or github, or even your own inbox somewhere, can act as the "main" repository.

The professional use of git is usually organized with the help of a “master” repo, on a bitpack that is writable only by pull request . Team members will fork the repository, do their work, and then, going to their own repository, issue a transfer request to the master repository. Then, peer-to-peer code review and successful download requests combined into the main repository can take place.

This contributes to a lot of good practice, and also means that you have a good clean repository that is backed up on some elses service.

We (in my organization) probably have more than 100 projects working this way, in many languages ​​and working very well.

There are several workflows that use this as a basis. Look here for a reasonable explanation.

+1
source

Git is distributed version control. You do not need to have a server. You and your friend can work on your 2 machines using git pull and git push without a server (the advantage of managing a distributed version).

You can always use a free (for small teams) server, for example https://bitbucket.org/

0
source

All Articles