I am attempting to create a local git repository using a mounted linux drive (via SSH via ExpandDrive) from my mac using GitBox, however when I attempt to make a commit I continually receive this error.

fatal: error when closing sha1 file: Permission denied

I am not exactly sure how to fix this. From other searches, I have attempted to change the .git permissions and also tried using another Git GUI (Tower) but to no avail.

  • have you tried just command line approach using git init? – mvp Mar 25 '13 at 6:56
  • Did you tried a git repo-config core.sharedRepository true on the repo? – VonC Mar 25 '13 at 7:41

Check permissions on the .git directory inside your repository, and what is inside. The data itself is in the .git/objects directory. An ls -lR .git should tell. It could be a very long list...

As it is some sort of external drive, it might be that the users don't match, or it is some filesystem that doesn't handle the file names used by git (unlikely, but I'd check for this too). Or it doesn't handle the permissions git it trying to give its files. I don't know how MacOS reacts on trying to close a file when there is no space, that also might explain the message. Or you might have run out of inodes. Can you create files there at all?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy