git push で「insufficient permission for adding an object to repository database」のerrorが出た場合の対象方法
リモートサーバにpushできない事態が発生したのでその対象方法を以下にメモしておく
以下のようなエラーが発生
$ git push
Counting objects: 7, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 392 bytes, done.
Total 4 (delta 3), reused 0 (delta 0)
error: insufficient permission for adding an object to repository database ./objects
fatal: failed to write object
error: unpack failed: unpack-objects abnormal exit
To git@*********:document.git
! [remote rejected] master -> master (n/a (unpacker error))
error: failed to push some refs to 'git@*******:document.git'
git サーバにログイン、対象のリポジトリに移動、以下のコマンドを実行
$ chmod -R g+ws * $ chgrp -R git * $ git repo-config core.sharedRepository true
開発マシンからもう一度pushする
$ git push Counting objects: 7, done. Delta compression using up to 2 threads. Compressing objects: 100% (4/4), done. Writing objects: 100% (4/4), 392 bytes, done. Total 4 (delta 3), reused 0 (delta 0) To git@*********:document.git c27c63c..b9ee86b master -> master