yum install git
mkdir /var/git cd /var/git mkdir play.git cd play.git git --bare init Initialized empty Git repository in /var/git/test.git/
git clone root@110.111.120.119:/var/git/test.git
收集全部須要登陸的用戶的公鑰,就是他們本身的id_rsa.pub文件,把全部公鑰導入到/home/git/.ssh/authorized_keys文件裏,一行一個
ssh-keygen -t rsa cat .ssh/id_rsa.pub
建立一個空的倉庫後,git pull/push 報錯,報錯信息以下Your configuration specifies to merge with the ref 'refs/heads/master' from the remote, but no such ref was fetched.
這是正常的,在本地目錄添加一個文件,commit 後 push 便可。git