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.
Asked
Active
Viewed 1,237 times
0
-
do you wish to use the webgit interface? – Малъ Скрылевъ Dec 15 '14 at 08:06
-
no I want to host git repo via ssh – Dhiren Hamal Dec 15 '14 at 09:33
-
if you wish to hist git via ssh, you don't require a server, because of you are able to access git repo via `git+ssh` protocol. – Малъ Скрылевъ Dec 15 '14 at 09:34
-
thanks for your reply.Can you provide me any resources or ideas how it is to be done? – Dhiren Hamal Dec 15 '14 at 09:41
1 Answers
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.
Малъ Скрылевъ
- 302
- 6
- 16
-
now how to add multiple user and assign password to each of them and what happend when multiple project such as server.git,client.git,common.git etc. I mean should I provide username and password for each repository or not? – Dhiren Hamal Dec 15 '14 at 10:55
-
@anondren if a user is require to be a just git, see on last link in the answer, ot others cases, just use linux user records – Малъ Скрылевъ Dec 15 '14 at 10:58
-
sir, suppose if there are dhiren and anon users which they want to access client.git repo then does they can able to provide dhiren@192.168.1.115:/srv/client.git command? – Dhiren Hamal Dec 15 '14 at 11:16
-
-
@anondren if you'll organize users named `dhiren` and `anon` at the server.the access to repo will be allowed – Малъ Скрылевъ Dec 15 '14 at 11:24
-
you mean it will accessable only if the client.git has defined users credentials? – Dhiren Hamal Dec 15 '14 at 11:30
-
Let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/19486/discussion-between---and-anondren). – Малъ Скрылевъ Dec 15 '14 at 11:31
-