push git库,报错。

今天有同事找我,问我怎么回事,去看的时间,发现确实是 权限问题,git库的 所有者 为 nobody,


remo@remo:/qualcomm/jenkins/r1528_ap/oe-core$ git push

Counting objects: 10, done.

Delta compression using up to 4 threads.

Compressing objects: 100% (5/5), done.

Writing objects: 100% (8/8), 676 bytes, done.

Total 8 (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 ssh://[email protected]/home/repogitgerrit/repositories/9x25oecore.git

 ! [remote rejected] master -> master (n/a (unpacker error))

error: failed to push some refs to 'ssh://[email protected]/home/repogitgerrit/repositories/9x25oecore.git'

remo@remo:/qualcomm/jenkins/r1528_ap/oe-core$ ls


原因:
git库权限的问题
$ ls -la,查看git库的所有者

解决:
在git库目录下:
$sudo chown -R git:git git库(9x25oecore.git')