0

I'v got Rails' app git repository with some executable files in bin directory. With permissions 646 -rwxr-xr-x each. I double checked and permissions are set correctly in git repository, but when I clone the repo I lose "x" for those files, so eventually they are -rw-r--r--. Any explanation ? My system is OSX, but I had many similar repos and it never happened before.

Artur79
  • 12,705
  • 1
  • 22
  • 22
  • There is a way to save the permissions: https://stackoverflow.com/questions/3207728/retaining-file-permissions-with-git – Richard Barber May 23 '19 at 07:35
  • `646` (assuming octal) would be `rw-r--rw-`. Git's commit will always show either mode `100755` (executable) or `100644` (not-executable); extracting such a commit calls `creat` (or `open(O_CREAT)`) with mode 0777 or 0666 respectively, relying on your umask to clear any unwanted bits. – torek May 23 '19 at 07:49
  • Thank, changing it to a+x was enough :) – Artur79 May 24 '19 at 08:16

0 Answers0