remove .git/index.lock': Permission denied
I had the exact same problem wanting to commit my changes to git, and solved it this way:
I needed to change the group of my
.git
folder and its contents:sudo chown -R <owner>:<group> .git
needed to change the permission of this folder:
sudo chmod -R 775 .git
Check which user owns the git lock:
ls -la /Applications/MAMP/htdocs/my_site/.git/index.lock
Then you can use sudo
to remove it.