4

I am having some trouble with git. Hopefully someone has some advice.
I have a master repository that is located on a NAS drive. Then I have user repositories on linux (ubuntu 12.04 server). The NAS drive is mounted on the linux server using CIFS so there is no need for either HTTP or SSH when transferring files from/to remote repositories.

When I try to push from a user repository to the master repository on the NAS I consistently get errors related the inability to set permission bits on the NAS. I have researched this alot over the last few days and although all users have read/write file permissions on the NAS, due to the way NAS works you cannot change the permission bits by doing a chmod. The permission bits on files created on the NAS are set from the mount command arguments (file_mode, dir_mode, etc).

This is the error I get when I try to push from a user repository to the master repository on the NAS:

dba@clp01:~/slave_repository.git$ git push master_git
Counting objects: 6, done.
Delta compression using up to 12 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (5/5), 2.52 KiB, done.
Total 5 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (5/5), done.
error: cannot fix permission bits on refs/heads/master.lock
fatal: Unable to create
'/mnt/nassource/master_repository.git/.git/refs/heads/master.lock': 
Operation not permitted
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
dba@clp01:~/slave_repository.git$ git config --global --list
user.name=DBA
user.email=dba@cont.com
core.editor=emacs
core.filemode=false
merge.tool=diff

Any advice would be greatly appreciated......

CharlesB
  • 86,532
  • 28
  • 194
  • 218
jrizos
  • 41
  • 1
  • 1
    The problem appears to be in file creation, not chmod. If you can't create a file across the CIFS mount, that's what needs to be fixed. – msw Sep 14 '12 at 13:48
  • dba@clp01:~/slave_repository.git$ touch /mnt/nassource/master_repository.git/.git/refs/heads/master.lock dba@clp01:~/slave_repository.git$ ls -l /mnt/nassource/master_repository.git/.git/refs/heads/master.lock -rwxrwxr-- 1 sysadmin nasshare 0 Sep 14 09:57 /mnt/nassource/master_repository.git/.git/refs/heads/master.lock dba@clp01:~/slave_repository.git$ chmod 777 /mnt/nassource/master_repository.git/.git/refs/heads/master.lock chmod: changing permissions of `/mnt/nassource/master_repository.git/.git/refs/heads/master.lock': Operation not permitted. I'm not sure of that. I can create files. – jrizos Sep 14 '12 at 13:59

2 Answers2

0

Does your NAS support NFS? Would likely be a better option for you.

cduffin
  • 200
  • 1
  • 4
0

I ran into this a few minutes ago. I tried to touch a new file on the remote server and it failed. So I used sudo git push theRemote and it worked. Might not be the smartest thing, but in my case it was getting hung up on a .lock file and no one else pushes to this repo, so it was fine.

jcollum
  • 43,623
  • 55
  • 191
  • 321