我有git錯誤:每次創建「git push origin master」時都沒有足夠的權限將對象添加到存儲庫數據庫中。
我試過這裏描述的解決方案:http://parizek.com/2011/05/git-insufficient-permission-for-adding-an-object-to-repository-database-objects/,但它只能工作到下一次...
有沒有一些永久的解決方案?Git:沒有足夠的權限將對象添加到存儲庫數據庫
$ git push origin master
Counting objects: 5, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 1.19 KiB, done.
Total 3 (delta 2), 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]/p/project/code
! [remote rejected] master -> master (n/a (unpacker error))
error: failed to push some refs to 'ssh://[email protected]/p/project/code'
$ git config core.sharedRepository true
$ git push origin master
Counting objects: 5, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 1.19 KiB, done.
Total 3 (delta 2), 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]/p/project/code
! [remote rejected] master -> master (n/a (unpacker error))
error: failed to push some refs to 'ssh://[email protected]/p/project/code'
$ sudo chmod -R g+ws *
$ sudo chgrp -R andrey *
$ git push origin master
Counting objects: 5, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 1.19 KiB, done.
Total 3 (delta 2), reused 0 (delta 0)
remote: <Repository /git/p/project/code.git> refresh queued.
To ssh://[email protected]/p/project/code
acd82d2..f401c90 master -> master
這是Ubuntu的使用:12.04.1,和git:1.7.9.5
你爲什麼要這樣做?使用github或gitorious或已經解決了這個問題的解決方案。 –
如果我在source forge中存儲代碼,可以使用這些工具嗎? – rodnower
@Stefan Kendall:也許用戶使用的是公司內部的Git項目,他或他的公司不想將他們的代碼移動到他們無法控制的外部服務上? –