GIT – Remove file permissions

In most cases it is useful to manage file permissions for such projects separated from GIT otherwise these permissions are forced on all machines checking out the respective repository. And that can really be a really tricky affair. To remove file permissions from repository, you can run these commands from within your project folder (where .git folder is situated):

$> git config core.fileMode false # to ban permissions for the current project
$> git config --global core.filemode false # to ban permissions for all projects on this machine -> can be run from everywhere on the machine where the git command is known

This have to be done on each machine, that pushes to the repository.

What if they are already in the repository?

If the wrong permissions are already in the repository, you have to correct them before banning them. How this can be achieved is described in my blog post http://www.ask-sheldon.com/recursively-set-permissions-to-files-and-folders/.

 

Leave a Reply

Your email address will not be published. Required fields are marked *

 

This site uses Akismet to reduce spam. Learn how your comment data is processed.