Git常用命令总结
一、服务器创建仓库
su git
cd /mnt/git/repositories
mkdir project.git
cd project.git
git init --bare
exit
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
找到gitosis.conf,新增用户组及权限
[group git-project]
writable = project
members = weiwei dbpoo
修改完毕push到服务器
git add .
git commit -am ‘add project'
git push origin master
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
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
git pull origin master