Git cannot lock ref 'HEAD': unable to resolve reference HEAD

后端 未结 10 1498
情深已故
情深已故 2020-12-15 16:57

I\'m trying to commit the changes to my repository but I receive the error below:

git -c diff.mnemonicprefix=false -c core.quotepath=false commit -q -F C:\\U         


        
10条回答
  •  北荒
    北荒 (楼主)
    2020-12-15 17:13

    I had the same issue after calling git commands with the root user inside the working copy. So the owner and owner group of various files under .git/ were changed to "root".

    When I switched back to my user account, git could not handle this files anymore, because of the lacking permissions.

    It worked again, after resetting the permissions with

    sudo chown -R [MY_USER]:[MY_GROUP] .git
    

提交回复
热议问题