I'm trying to run:
git checkout master and im constantly getting: fatal:
failed to read object 9466835e6cb608c32ec4bf98b2acfa421fd77d3d: Permission denied I tried running:
chown -R my-user * with no help. any suggestions?
First Try
sudo chmod -R 777 path_to_your_project_folder If it does not work try below solution.
Try to do this happens sometimes when dangling blobs are left in git history. You can backup your .git folder and run fsck.
$ git fsck --full Refer this answer for more details
777 is the wrong mode. Most internal .git. files should be 0444 or 0644 or 0664, and most directories should be 0755 or 0775. (However, Git hooks need to be executable, hence 0755 as well.) If your computer is not shared with anyone, 777 will be OK, but if it is shared, you're inviting others to mischief...sudo git fsck --full as still got permission denied without running as root
ls -l) the file.git/objects/9/466835e6cb608c32ec4bf98b2acfa421fd77d3dto see its existing owner and mode. If you ran various Git commands withsudoit may be owned byroot. Inspect the.git/objects/directory as well for all its subdirectories as some of them may be owned by root. Yourchown -Ris probably going to be a correct solution, except that*will not match.gitand therefore it has not been applied to any of the files within.git.