Git常用命令总结

服务器创建仓库

su git
cd /mnt/git/repositories
mkdir project.git
cd project.git
git init --bare
exit

管理gitosis的配置文件

clone gitosis-admin.git
找到gitosis.conf,新增用户组及权限
[group git-project]
writable = project
members = weiwei dbpoo

修改完毕push到服务器

git add .
git commit -am ‘add project'
git push origin master

初始化项目

mkdir project
cd project
git init
echo ‘123’ >> hello
git add .
git commit -am ‘initial project'
git remote add origin git@git.tapzh.com:project.git
git push origin master

其它机器clone&pull

git clone git@git.tapzh.com:tapzh.git
git pull origin master