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

If you do a “git add” or other commands and get this error “insufficient permission for adding an object to repository database .git/objects”, it means that you must have used other user to commit or make changes to the git repo before. The best fix is to manually change the user permission of the git objects in your repo, ie

cd your_git_repo/.git/objects
chown your_username:your_username -R *

Author: bpeh

Bernard Peh is a great passioner of web technologies and one of the co-founder of Sitecritic.net Website Design and Reviews. He works with experienced web designers and developers everyday, developing and designing commercial websites. He specialises mainly in SEO and PHP programming.