我在我自己的服務器(Ubuntu 14.04)上有一個Git repo,一切工作正常,但現在如果我嘗試從服務器推送一些提交到repo我得到這個錯誤的服務器:Git推送錯誤,權限不足,未能寫入對象
Counting objects: 51, done.
Compressing objects: 100% (22/22), done.
Writing objects: 100% (26/26), 2.78 KiB | 0 bytes/s, done.
Total 26 (delta 23), reused 7 (delta 4)
remote: error: insufficient permission for adding an object to repository database ./objects
remote: fatal: failed to write object
error: unpack failed: unpack-objects abnormal exit
To ssh://[email protected]/home/git/projects/myproject/
! [remote rejected] master -> master (unpacker error)
error: failed to push some refs to 'ssh://[email protected]/home/git/projects/myproject/'
我知道,我不應該從服務器推,但我需要(我不高興)。
我的Git的配置文件是這樣的:
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[branch "master"]
[remote "origin"]
url = ssh://[email protected]/home/git/projects/myproject/
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
[receive]
denyNonFastForwards = True
如果我克隆回購在服務器上的新位置,這個問題一直來了。如果我從Windows PC推送到服務器,一切都很好。
有沒有人有任何想法呢?
我試過Git Push Error: insufficient permission for adding an object to repository database已經對問題沒有任何影響。
權限設置正確。我幾小時前推出了數據到回購站(從服務器到服務器,從PC到服務器),沒有任何問題。
的可能重複[混帳推錯誤:沒有足夠的權限,用於添加對象存儲庫數據庫(http://stackoverflow.com/questions/6448242/git-push-error-sufficient-permission-for-adding-an-object-to-repository-datab) –
謝謝你的想法,但我已經試過了...... – fehmelchen
所以你從一個目錄在另一臺服務器上?如果是這樣的話,爲什麼還要用ssh來進出?只需定義一個相對參考作爲您的遠程。這至少可以降低幫助診斷問題的複雜性。 –