3

When pulling from my remote develop branch, I get a long series of messages like this:

unable to unlink .git/objects/fe/4f55215c297e73e7115d0792257155fa1a0307: Operation not permitted

I shut down IntelliJ and all other open editors as suggested here, but the error persisted. I tried to chflags on all files, as written here, but it did nothing. I also tried chowning all files to my user and forcing write permissions with chmod both on files and on the directory itself, recursively (both from my user and sudo, I tried simply +x, then 775), but to no avail.

I cannot get rid of these messages. This happens only when pulling develop. Other branches are fine.

Community
  • 1
  • 1
Totem
  • 454
  • 5
  • 18
  • Is this message from local git repository, or from remote git repository? – Jan Marek Jul 25 '16 at 08:30
  • Can you delete them manually? – AnoE Jul 25 '16 at 08:58
  • From a local repository. Oddly, I can unlink them: I tried unlinking one of them and I received no errors; I repeated the same command and I received a rightful error telling me the file does not exist (because I already unlinked it). oddly enough, however, the same file gets reported again in the list of messages when I try to pull again. – Totem Jul 25 '16 at 12:39

1 Answers1

2

I get this quite often at work. Our team consists of 2 windows, 3 linux and 1 ios users. Somewhere, someone is pushing files with dodgy permissions which causes the live Linux server to throw a hissy sometimes.

What I've always found fixes this is simply removing the gc.log file, i.e

rm .git/gc.log

Then on your next pull all the errors will be gone. What I think actually happens is the files do get unlinked in the first place, however the log file isn't updated correctly, so then on the next pull it try's to remove them again even thought they do not exists and throws an error.

Doug
  • 1,850
  • 23
  • 50