In this article, we will setup a git server from team access. It is mimic the SVN style workflow(Centralized Workflow), it’s a easy way for integrating all code in one place.

Main Steps

  1. init bare repository
  2. add user
  3. first commited
  4. clone

init bare repository

create a bare repository in /opt/git/project.git

$ git --bare init
Initialized empty Git repository in /opt/git/project.git/

add user

add a user called ‘git’ for executing git commonds.

$ adduser git

change git’s password

$ passwd git

first commited

# on SomeBoday's computer
$ cd myproject
$ git init
$ git add .
$ git commit -m 'initial commit'
$ git remote add origin git@gitserver:/opt/git/project.git
$ git push origin master

clone

git clone git@gitserver:/opt/git/project.git