0

Hi I don't know why I'm getting this error while pushing in Git. I already commit and pull it.Thank you

Counting objects: 55, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (31/31), done.
Writing objects: 100% (31/31), 3.31 KiB, done.
Total 31 (delta 25), 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 x@10.11.16.52:/opt/git/web-client.git
 ! [remote rejected] master -> master (n/a (unpacker error))
error: failed to push some refs to 'x@10.11.16.52:/opt/git/web-client.git'
akbsmile
  • 1,119
  • 2
  • 11
  • 15

1 Answers1

1

It seems that in the remote repository (the one where you are pushing) your user does not have enough permission to create a new file.

BTW, if you are using a remote repository shared by several users (usually created with git init --shared --bare), I suggest you to do the following things:

  1. Create a proper group of users (e.g., git-users) which will have read/write permissions: sudo addgroup git-users
  2. Assign ownership of the repo to this group: sudo chown -R root:git-users myrepo
  3. Give write permissions to the group: sudo chmod -R 'g+w' myrepo
  4. Give setuid permissions to the group: sudo chmod 'g+s' myrepo
Claudio
  • 10,614
  • 4
  • 31
  • 71