1

I have a Git repo on my own server (Ubuntu 14.04) and everything was working fine, but not now if I try to push some commit from the server to the repo on the server I get this error:

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://git@myserver/home/git/projects/myproject/
 ! [remote rejected] master -> master (unpacker error)
error: failed to push some refs to 'ssh://git@myserver/home/git/projects/myproject/'

I know, I shouldn't be pushing from the server, but I need to (I'm not happy about it).

My Git config file is this:

[core]
        repositoryformatversion = 0
        filemode = true
        bare = false
        logallrefupdates = true
[branch "master"]
[remote "origin"]
        url = ssh://git@myserver/home/git/projects/myproject/
        fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
        remote = origin
        merge = refs/heads/master
[receive]
        denyNonFastForwards = True

If I clone the repo in a new location on the server, the problem keeps coming up. If I push from my Windows PC to the server everything is fine.

Has anyone any idea about it?

I've tried Git Push Error: insufficient permission for adding an object to repository database already without any effect on the problem.

Permissions are set correctly. I pushed a few hours ago data to the repo (from server to server and from pc to server) without a problem.

Community
  • 1
  • 1
fehmelchen
  • 203
  • 3
  • 15
  • 2
    possible duplicate of [Git Push Error: insufficient permission for adding an object to repository database](http://stackoverflow.com/questions/6448242/git-push-error-insufficient-permission-for-adding-an-object-to-repository-datab) – Tim Biegeleisen Sep 26 '15 at 16:15
  • Thanks for the idea, but I already tried that ... – fehmelchen Sep 26 '15 at 16:16
  • 1
    So you're pushing from one directory on the server to another? If that's the case, why bother coming in and out with `ssh`? Just define a relative reference as your remote. This might at least reduce the complexity to help diagnose issues. – Jeremy Fortune Sep 26 '15 at 16:31
  • This worked. Thank you very much! – fehmelchen Sep 26 '15 at 17:11

1 Answers1

2

I changed my git remote url so there is no ssh via

git remote set-url origin /home/git/projects/myproject/
fehmelchen
  • 203
  • 3
  • 15