fatal: unable to write new index file

Pavel March 19, 2014

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:

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

http://stackoverflow.com/questions/3715031/git-fatal-unable-to-write-new-index-file-while-commit

http://stackoverflow.com/questions/3813962/git-problem-fatal-unable-to-write-new-index-file

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

http://stackoverflow.com/questions/22102613/does-git-generally-choke-on-mounted-drives-or-just-git-guis


What could I do?

2 answers

1 accepted

0 votes
Answer accepted
Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 19, 2014

The easiest, most robust solution will be to let your developers have the local repositories on their machines. The entire point of creating a DVCS like Git is so that the user can interact with their repository regardless of network connectivity.

If you want to require the network connectivity (maybe you are concerned developers will give away your proprietary code if they take their macbooks home, I can't think of any other reason to require this), then a DVCS isn't the right choice for you. Use SVN instead.

If you want to make sure developers' code is backed up, either task them with committing/pushing often, or download/purchase some backup software.

Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 19, 2014

Please feel free to explain why hosting "local" repositories on network storage is desirable/required. If you've got a good reason, people will be more likely to try to help you find solutions.

0 votes
Pavel March 19, 2014

@Seth FossThank you for your prompt answer. Is it realy so, that GIT has problems with AFP/ shared folder? If it is so, I'll make the lokal solution you recommended. It was my second plan.

The reason for hosting "local" repositories on network storage was, that the web development testing server is allready configured for development and test of source code and backup. Also each developer could give a Link to other emploees in order to test the system.

If you can handle your GIT-Repository only localy, you should to configure/activate development environment, backup and share every Mac for other.

If it doesnt work with the network storage, I'll backup every mac and server and separatelly copy and backup local GIT-Repositoris.

Best regards

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events