0

Hello this post has the same question as mine but the solution does not fix the problem.

I have tried sudo and this is the outcome:

(base) me$ sudo git clone https://github.com/soobinck/rotarod_ML.git
fatal: could not create work tree dir 'rotarod_ML': Permission denied

My problem, same as the post I mentioned above, is:

(base) brclab@FACMED006068:/run/user/1000/gvfs/smb-share:server=files.ubc.ca,share=team/bnrc/ninc/Raymond Lab/SooBin$ git clone https://github.com/soobinck/rotarod_ML.git
Cloning into 'rotarod_ML'...
error: chmod on /run/user/1000/gvfs/smb-share:server=files.ubc.ca,share=team/bnrc/ninc/Raymond Lab/SooBin/rotarod_ML/.git/config.lock failed: Operation not supported
fatal: could not set 'core.filemode' to 'false'

I would try this solution but since I don't know much about git and the remote computer (Linux), I wouldn't try messing around.

Can someone please give me guidance as to how to clone and pull the git repository? Thank you.

underdisplayname
  • 273
  • 3
  • 14

1 Answers1

4

It looks like you're using an SMB share on Linux. When you use Git on a Unix system, it expects a file system where it can change the permission on the files with chmod(2). In your case, that doesn't work, and so when Git tries to information to the config file during the clone process, it fails.

My recommendation is that you clone onto a file system that isn't on an SMB mount. Git usually requires a POSIX-compliant file system, and on your system, that isn't one. Note that it's possible that if you use the cifs kernel driver to mount this file system and not gvfs, that it may work for you. gvfs's fuse mounts don't always expose all the proper functionality of the file system and don't necessarily work.

bk2204
  • 64,793
  • 6
  • 84
  • 100
  • Thank you for your reply bk2204! I don't fully understand some terms you used but it sounds like I have to `git clone` on a machine where I can have the 'write' permission. Also, I need to use a driver with `cifs kernal`. – underdisplayname Mar 20 '21 at 16:58
  • Here are some follow-up questions: – underdisplayname Mar 20 '21 at 16:58
  • 1. Would `chmod(110)` work? Adding being to read functionality. – underdisplayname Mar 20 '21 at 16:58
  • 2. I don't understand why I don't have permission to write. I am able to move and save files in this drive. – underdisplayname Mar 20 '21 at 16:58
  • 3. Is there any way to modify the kernal driver to `cifs`? I do not own the drive. It's from my school. – underdisplayname Mar 20 '21 at 16:59
  • 4. Is there any way to use `--user` option for git clone? I ask this question because when I try to install some packages, I **must** use the `--user` option for `pip install`. I wouldn't work without the argument. – underdisplayname Mar 20 '21 at 17:01
  • You need to not use GVFS to mount this disk. You need to mount it using `mount.cifs` instead. That may or may not be sufficient to fix the problem, but it is more likely to get things working for you. – bk2204 Mar 20 '21 at 17:03