Attempting to clone a remote Git repository into a CIFS mounted directory on Linux.

The error is:

$ git clone ssh://git@github.com/ghuser/ghuser.git dir
Cloning into 'dir'...
fatal: Unable to create temporary file '/home/user/dir/.git/objects/pack/tmp_pack_XXXXXX': Permission denied
fatal: index-pack failed

Some potentially relevant information:

$ uname -a
Linux myfarms-dev 3.12.0-1-ARCH #1 SMP PREEMPT Wed Nov 6 09:06:27 CET 2013 x86_64 GNU/Linux

$ cat /etc/fstab
// /home/user/dir cifs users,exec,noauto,credentials=/home/user/.smbcredentials,uid=user,gid=http,file_mode=0775,dir_mode=0775 0 0

$ umask

This exact same process works for most of our developers (i.e. mounting a Windows share in Linux and cloning the repository into it), but not for this one in particular. Any ideas?

Edit: Steps I have taken so far: Updated packages, remounted file share, checked permissions on the directory on the Windows side (full access to the user). The error initially occurred during a git fetch inside an existing repository. Git (or something) seemed to be creating tmp_pack files without u+w permission, despite the umask. I deleted the entire local repository and started anew, which resulted in the above error during clone.

1 Answer 1


After some tests and searching I find 2 options:

  1. Downgrade kernel to version 3.11.6
  2. Launch git commands with sudo. (https://superuser.com/a/121854/275562)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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