Git reports insufficient permission for adding an object to repository database. Git/objects

Source: Internet
Author: User

Git reports an error in pull, which occurs as follows:

[Lixinglei @ bogon my] $ ll-A | grep. gitdrwxrwxr-X. 8 lixinglei 4096 June 6 19:58. git-RW-r --. 1 lixinglei 109 April 23 14:02. gitignore [lixinglei @ bogon my] $ cd. git [lixinglei @ bogon. git] $ CD objects/[lixinglei @ bogon objects] $ ll | grep rootdrwxr-XR-X. 2 root Root 4096 May 27 19:37 3bdrwxr-xr-x. 2 root Root 4096 May 27 19:37 68

According to the error message, it is found that some files under ". Git/objects" belong to a problem:

[lixinglei@bogon my]$ git pull git@XXX.XXX.XXX.XXX:XXX.gitremote: Counting objects: 29, done.remote: Compressing objects: 100% (22/22), done.remote: Total 22 (delta 17), reused 0 (delta 0)error: insufficient permission for adding an object to repository database .git/objectsfatal: failed to write objectfatal: unpack-objects failed

Use root to log on and enter the directory:

[Root @ bogon objects] # ll | grep rootdrwxr-XR-X. 2 root Root 4096 May 27 19:37 3bdrwxr-xr-x. 2 root Root 4096 May 27 19:37 [root @ bogon objects] # chown lixinglei: 3B [root @ bogon objects] # ll | grep rootdrwxr-XR-X. 2 root Root 4096 May 27 19:37 [root @ bogon objects] # chown lixinglei: 68 [root @ bogon objects] # CD 68 [root @ bogon 68] # ll total usage 4-r -- r --. 1 Root 213 May 27 19:37 login [root @ bogon 68] # chown lixinglei: cb6ab3332e342158b1b27341a2c1_cd570a4c [root @ bogon 68] # CD .. /[root @ bogon objects] # cd 3B [root @ bogon 3B] # ll total usage 4-r -- r --. 1 Root 1647 19:37 d60abd850ecacb4002ed870176172426f662d2 [root @ bogon 3B] # chown lixinglei: d60abd850ecacb4002ed870176172426f662d2

Run git pull again.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.