2

I want to set/change permissions for all files to 770 in git. i.e. I want the all files when I make "git clone" or "git pull" to have the permission 770

Currently the files have 644 When I do to a file "git update-index --chmod=+x" it changes to 755

Does anyone has a solution?

dritan
  • 882
  • 2
  • 8
  • 22
  • You might want to look here: http://stackoverflow.com/questions/3740152/how-to-set-chmod-for-a-folder-and-all-of-its-subfolders-and-files-in-linux-ubunt – pablaber Jul 31 '15 at 14:22
  • @pablaber this changes the permissions at the local directory but not on the central repository. I want that after git clone the file permission are 770, so that I do not have to do chmod -R 770 . – dritan Jul 31 '15 at 14:30

1 Answers1

0

Temporarily set your umask to 007, then clone the repo: (umask 007 && git clone path-to-your-repo.git). Files will still not have executable permission, as that's the sane thing to do by default. If you really really want to set the executable flag for all your files, just do find your-local-repo-path -type f -exec chmod +x {} \; and add the result with git add ..

Note that most of this only effects your local repo, as git only stores the executable and symlink bit. Everything else will be lost. If you want to assert full control over the metadata, you'll have to use a tool like metastore.

tarleb
  • 19,863
  • 4
  • 51
  • 80