Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git repository with multiple users on Ubuntu

I have an existing bare git repository located in /home/myaccount/git/project. I am currently using it over ssh from my local machine without any problems. I want to add a second user on the server which only shall access to this git repository (maybe move the repo outside my account folder?). How? Using latest version of git and ubuntu on slicehost.

I have this setup: user: sleepyhead user: developer1 group: git. both sleepyhead and developer1 are members of this group repository /home/sleepyhead/git/project1

I want to: move repository to a proper place, either /home/git/project1 or /usr/local/git/project1. What is recommended? developer1 should permissions to read and write project1 with git. no other permissions should be given.

I do not know how to properly set the permissions and to restrict developer1 to only have access using git to project1.

like image 917
Espen Avatar asked Dec 11 '08 18:12

Espen


People also ask

Can a GitHub repo have multiple owners?

Repositories owned by personal accounts have one owner. Ownership permissions can't be shared with another personal account. You can also invite users on GitHub to your repository as collaborators.

How do I add multiple owners to a GitHub repository?

On GitHub.com, navigate to the main page of the repository. Under your repository name, click Settings. In the "Access" section of the sidebar, click Collaborators & teams. Click Invite a collaborator.


1 Answers

Have him create a ssh keypair and send you the public key.

Add the public key to your ~/.ssh/authorized_keys file, and add the command="..." option to limit it to the git-shell - see this link for an example.

like image 97
orip Avatar answered Oct 07 '22 05:10

orip