简体   繁体   中英

Cannot push in git repository

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'

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 (eg, 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM