Error while pull from git - insufficient permission for adding an object to repository database .git/objects

前端 未结 5 686
臣服心动
臣服心动 2021-01-29 21:12

I have git error: \"insufficient permission for adding an object to repository database .git/objects\" every time I make \"git pull origin develop\".

    remote:         


        
5条回答
  •  生来不讨喜
    2021-01-29 21:56

    Assuming @ChrisHayes is right about an accidental sudo, this should fix it. From inside your repository:

    sudo chown -R $USER:$USER "$(git rev-parse --show-toplevel)/.git"
    

    Update: for those of you getting the illegal group name error, try this instead:

    sudo chown -R $(id -u):$(id -g) "$(git rev-parse --show-toplevel)/.git"
    

提交回复
热议问题