1

My Company (Web Development) has decided to use Git. All repositories: employee (local repo) and remote repositories (bare repo) are stored on the central development server (OS X 10.9.1, Mac mini middle 2011). Developer connect to the development server from their iMacs over local network (OS X 10.7.5, 10.8.1 and so on, only Macs) and write the source code there. A Git client on Mac called Sourcetree should do the whole work. But after a few commits or some other git operations I get sooner or later following message:

fatal: unable to write new index file

After the message GIT can track the changes in the project, but I can't save anything to git. Even by using terminal or anotrher GIT-GUIs (I have tried Coda, GitHub) I get the same error message. If the git client and the repository are stored on the same mac, everything works fine (tried on the development server and two iMacs). The problem occurs only if the git client has to connect to the repository over local network (AFP).

If I start the Git client on the development server and save some changes to the „damaged“ repository, everything works again. Also over local network. But if i work then in the repository on the development server with my local git client from my iMac over local network, I get sooner or later (mostly after a few adds or commits) the same error message. I connect or login on server allways as the same user. Also Git client connects as the same user.

I suspect, that the reason is AFP.

I have enouth free space on the central development server. And have enouth file permissions, at least initially. These topics were not helpful for me:

https://apple.stackexchange.com/questions/111934/git-not-working-over-afp

GIT: "fatal: unable to write new_index file" while commit

git problem : fatal: Unable to write new index file

https://answers.atlassian.com/questions/155102/sourcetree-error-fatal-unable-to-write-new-index-file

Does Git generally choke on mounted drives? Or just Git GUI's?

What could I do?

Community
  • 1
  • 1
Pavel
  • 11
  • 1
  • 3
  • Likely you should periodically call a script on the remote side which would fix file permissions. But you should remember that usually GIT workflow is slightly (or significantly in one's eye) different: first you download the whole repo to a local computer (or even make few copies locally), then you make new commits, change them as you need and so on, and then, when you think you're ready to give you beautiful code to the world, you push your changes to a remote server accessible for you and your colleagues. – user3159253 Mar 20 '14 at 12:52

1 Answers1

1

We've run into the same issue repeatedly, especially as we try to use XCode 6. I'm currently changing over my connect to our server to WebDAV (connecting to our server via Finder > Go (menubar) > Connect to Server... > https://localnetworkIP/userfolder/).

This is working for us (so far).

UPDATE: After a few days, I noticed a new issue using WebDAV: files would disappear from view in the Finder causing XCode/Git to think that the file had been deleted. Looking at the server showed that the files were still there.

I then changed my connection type to SMB. This has worked well for me: Git no longer encounters file permission errors, and Finder (OSX 10.10 Yosemite) doesn't "loose" files.

Tim Newton
  • 1,463
  • 1
  • 13
  • 13