I ran into this error, and found very little documentation on how to fix it online. I got the error by trying to run the command git add ., and received this re
git add .
Try git checkout my_branch -f
git checkout my_branch -f
As given here: http://www.nullreference.se/2010/08/20/git-merge-error-permission-denied/