centos 7 git 1.8.3 yum -y install git
mkdir /myGit git init --bare xiangyun.git
useradd 用戶
passwd 用戶
注:通過測試, /sbin/nologin 之後不容許提交了
修改用戶及用戶組權限
chown -R xiangyun:xiangyun xiangyun.git ===》注意這部很重要,不然push的時候沒有權限
git clone zhaomo@192.168.1.101:/myGit/test.git
-------------------------------------------------
下面這些是我備註的經常使用提交使用命令,,,,與本博客無關
提交到緩存區:
git add .
git commit -m "abcd"
第一次須要輸入你的用戶名和郵箱:
第一次提交,你要是不輸入會報錯
git config user.email "zhaomo@qq.com"git
git config user.name "bala"centos
全局的須要加入:緩存
git config --global user.........測試
提交:spa
git push origin master3d
$ git push origin master zhaomo@192.168.1.101's password: fatal: protocol error: bad line length character: This
$ git push origin master
zhaomo@192.168.1.101's password:
Counting objects: 3, done.
Writing objects: 100% (3/3), 202 bytes | 202.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)
remote: error: insufficient permission for adding an object to repository database ./objects
remote: fatal: failed to write object
error: remote unpack failed: unpack-objects abnormal exit
To 192.168.1.101:/myGit/test.git
! [remote rejected] master -> master (unpacker error)
error: failed to push some refs to 'zhaomo@192.168.1.101:/myGit/test.git'code