Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Finally decided to move from Subversion to Git, but am having problems with my first project. Did my "git init" and am trying to do a "git add" of my project, but it's failing with:

$ git add .
error: unable to set permission to '.git/objects/6b/6018c1c76dc5ec159d5cb65bab72
fa300d52f6'
error: build.xml: failed to insert into database
error: unable to index file build.xml
fatal: adding files failed

I have full permissions to the directories in question. The only odd thing about it is that it's a drive mounted (and mapped) from a server over CIFS. No problems creating/editing files/permissions with other applications. The host is Windows Vista x64 and I'm running git under Cygwin. Server is Windows 2008.

Any other ideas on what I might be doing wrong?

share|improve this question

3 Answers 3

up vote 3 down vote accepted

Well, after much experimentation and reading of the git mailing list, it appears that chmod functionality is broken in Windows for CIFS network drives. Apparently git works fine locally, but just won't work across the network in Windows environments.

share|improve this answer
chown yourname:yourname .git -R

The hidden .git directory needs to be overwritten with the correct permissions.

share|improve this answer

Had similar issue. I'm hosting my git repositories on a windows server running cygwin sshd. In my case I found my git repositories are palced over a network location, and I had to edit the windows security settings on net network mapping (my computer -> Network locations -> right click on your network map).

I had to enable full control for Everyone group (which obviously not very ideal) but since we're just a small development team and this is an internal network we think it's an acceptable temporary solution

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.