2011年2月8日

Basis of GIT server

If you are the construction manager or IT engineer, you will need to service developers to access GIT server. Here's a good article for reference.

Reference: http://yuanfarn.blogspot.com/2010/08/debian-ubuntu-gitosis-git-server.html

1. Install gitosis

2. add user git
$ sudo adduser --system --shell /bin/sd --gecos 'git version control' --group --disabled-password --home /home/git git

3. Generate a key
$ ssh-keygen -t rsa

4. initial server by this key
$ sudo -H -u git gitosis-init < /tmp/id_rsa.pub
$ sudo chmod 755 /home/git/repositories/gitosis-admin.git/hooks/post-update

5. download gitosis-admin.git using git
$ git clone git@YOUR_SERVER_HOSTNAME:gitosis-admin.git

6. switch to the gitosis-admin folder, and copy the SSH key into the keydir folder.

7. Add a new project "Hello" by edit gitosis.conf


+[group]
+writable = hello
+members = online@local

8. commit to repository
$ git commit -a -m "your comment here...."
$ git push

9. implement your Hellop project

$ mkdir hello
$ cd hello
$ git init
$ touch README
$ git add .
$ git commit -a -m 'initial version'
$ git remote add origin git@server_name:hello.git
$ git push origin master

沒有留言:

張貼留言