There are a few ways to host your own Linux server.
This setup is maybe the simplier one, and it is suitable for very few contributors.
Prepare de server
First thing to do, is to create the group in the server for the contributors.
group add git-users
Next step, create the users for the contributors.
useradd -m -g [initial_group] -G [additional_groups] -s [login_shell] [username]
Using that template create the users with something like this:
useradd -m -g users -G git-users -s /bin/bash contributor1
Repeat for as many users as you need. Set the passwords
Create the repository
cd /usr/share mkdir /usr/share/git-repos git init –bare /usr/share/git-repos/project.git
chown -R root:git-users /usr/share/git-repos/
It is now ready to accept push, pull and clone.
git clone contributor1@[server-ip]:/usr/share/git-repos/project-git
Add a remote
git remote add local contributor2@[server-ip]:/usr/share/git-repos/project-git