Git push error: Unable to unlink old (Permission denied)
If you are using any IDE most likely the problem is that file was used by some process. Like your tomcat might be using the file. Try to identify that particular process and close it. That should solve your problem.
sudo chmod -R ug+w .;
This command would fix the issue. It gives write permissions to the folder.
When you have to unlink file, you have to have permission 'w' for directory, in which file is, not for the file...