一. 服务器端操作
1. 创建git服务器目录
mkdir -p /www/repositories
cd /www/repositories
2. 初始化一个空的Git资源库, 如果需要的话,启动Git守护进程
$ GIT_DIR=myproj.git git init
$ git daemon --detach --verbose --export-all --enable=receive-pack --base-path=/www/repositories/
二. 客户端操作
1. 初始化Git资源库
$ git init
$ git add .
$ git commit -m "Initial commit"
2 把你的项目推到服务器
$ git push git://服务器地址/path/myproj.git HEAD
3一个开发人员可以这样check out源码:
$ git clone git://服务器地址/myproj.git