1

I am trying to have (git) versioning on a fileshare , but when running git init or git clone I get:

error: chmod on /[my folder]/.git/config.lock failed: Operation not permitted

is there a workaround ? or we have to use blobs versioning ?

thanks

jjrr
  • 1,038
  • 2
  • 13
  • 26

2 Answers2

2

This seems to be the same problem already solved in Prevent git from failing on filesystems without chmod permissions in Linux.

Basically git tries to do a chmod after it created the files and on filesystems where that is not allowed git fails.

The workaround is to create the repository on a different filesystem and move the files over after they have been created.

Sadly even the latest version of git seems to miss a command line option to disable that call to chmod.

SebDieBln
  • 3,303
  • 1
  • 7
  • 21
0

error: chmod on /[my folder]/.git/config.lock failed: Operation not permitted

There are limitations on certain Git operations because they require file system-level permissions that may not be available.

I also tried to execute the same commands in my VM but faced the same issue, just like you.

enter image description here

In order to resolve the issue, try to run the same command with sudo or run the same commands from the root user

  sudo git init
  sudo git clone

Result:

enter image description here

When I try to run it from the root user, it's working fine.

Note: If you create a user locally, try to add the same user to the sudo group for executing the git commands.

enter image description here

Venkat V
  • 2,197
  • 1
  • 1
  • 10