Git Error on Pull: "Operation Not Permitted"

7.3k Views Asked by At

When pulling changes from a remote branch, Git is throwing me this error:

From https://github.com/JackWebbHeller/MyProject

* branch master -> FETCH_HEAD

error: unable to unlink old 'MyProject/folder/directory/index.html' (Operation not permitted)

That was taken from the transcript from Tower for Mac. Can anyone advise? Thanks!

2

There are 2 best solutions below

1
On BEST ANSWER

You probably have file index.html open in another editor.

The file was changed on the server and git tries to modify it.

1
On

One other possible situation is if you are on a mac and the file has been flagged as "locked", in which case the file is read only and git can not remove it. Solution is to check the file in your finder and remove the flag in "Get info" option.