Search code examples
gitserveruser-accounts

Git repos accessible by multiple users without actual user accounts on server?


So far I've only used git locally (my own repos) or public i.e. github, gitlab, and bitbucket.

I would now like to setup a bare repository on a Linux (Ubuntu) server, which is then to be used by myself and several others developers.

I don't want to give everyone their own user account on the server. However I do want to distinguish which changes are committed by who.

What is the best way to set this up? I mean best in terms of easy of use and security.

Do I make one generic 'git' user on the Linux server, and then how do I and other developers connect to it and checkout the repository? Also, I preferably wouldn't want the others to actually log in, they should have only access to the git repository.


Solution

  • I think, it's described pretty well in the official Git documentation here:

    https://git-scm.com/book/en/v2/Git-on-the-Server-Setting-Up-the-Server

    When you setup git repository on the server and add appropriate SSH keys for each user according to the documentation, it should work fine.