0

I want to create git server and want to host a java project which has been written in 3 tier archituctere, it means that their might be multiple project(git repository) such as client, server, common etc. to all other developers with their own credential(username, password). The other developers will pull and commit through their own username and password. I don't know how it is to be done even I had search different sites and forume but I din't get it. plz help me from scretch.

1 Answers1

0

Common approach to organize ssh repo on a server. Just create a folder /git in root folder, then assign a group to it with write permissions, and all the users, which be able to read or write to the repo, assign to the group. So a user can create git repo:

$ cd /git
$ mkdir project-1
$ cd project-1
$ git init
$ touch README
$ git add README 
$ git commit -m "Initial commit"

Of course you should have the properlt setup users account on both local and remote PCs. So for example, we create the user account user1 on local PC, and user2 on the remote one:

$ sudo useradd user1
$ ssh sudo useradd user2
$ sudo remote_pc -c 'sudo useradd user2'

Then we should be able to issue git commands: clone, pull, and push:

$ git clone git+ssh://user2@remotepc/git/project-1
$ cd project-1
$ git pull
$ git push

Ypu also should know on how to configure passwordless access to remote git repo via ssh, and to setup git-shell.