Does git usually choke on mounted drives? Or just a Git GUI?

I know that I have to be restrained and use git in the terminal, but I use a git client on a Mac called Sourcetree to make it all a little sexier.

The problem is the new Synology NAS, which I added to my setup. With one of the NAS shared folders installed on my Mac, Sourcetree suffocates when trying to execute / commit / click.

My main branch is on GitHub, so I cloned the repo to a mounted drive using Sourcetree. As a quick test, I edited a non-essential file, saved and watched for unidentified changes in the client. Success so far; the edited file appears in an uninstalled Sourcetree window. I'm going on stage. Fatal error:

git -c diff.mnemonicprefix = false -c core.quotepath = false -c credential.helper = sourcetree add -f - README.md

fatal: unable to write new index file

Done with errors, see above

I looked at the file’s file permissions in a hidden .git folder (using the NAS directory explorer because the Mac doesn’t show the hidden file. File permissions were read, written, but not executed. After the file was resolved, the scene / commit / push attempts with Sourcetree worked.

Obviously, I don’t want to go and manually configure file permissions every time I clone a git repository, so does anyone know why Sourcetree / Git does not create a repo clone with more useful file permissions?

For the record, I tried the same operation with the GitHub OSX client, which seemed successful (there is no need to edit permissions). But I believe that the GitHub client is a bit primitive and prefers to use Sourcetree.

+6
source share
2 answers

This is generally git. This answer suggests that this is due to file locking. For more information, just find SO for "git samba"

In my experience, working with a non-bare repo on a network drive is a bad idea.

For best practices: http://git-scm.com/book/ch4-1.html

So either:

  • Set up an SSH server on your NAS and push / pull it to
  • Match your network resource (as it is now), but put a bare repo on it. Then press and pull it.

In any case, it is recommended that the git repository with the working copy be on the local drive.

+5
source

After a lot of time lost, I came to the following solution:

On the NAS Synology Server:

control panel → File sharing and privileges → Win / Mac / NFS → Mac file service → Apply default permissions for Unix - select this check box and restart the file service.

Red herrings are the things I tried, it didn't work.

a) change your Git setting using the NAS directly, using Git Server via ssh. b) using / not using Sourcetree to access Git c) maybe a dozen other things.

Please note that the problem is not related to installing Git, but rather with the location of the directory in which the check takes place. without checking the field above, I could not change the permissions or ownership of the index file even through the terminal, although I have to do this through SSH.

Robert Rami

+1
source

All Articles