How to disable file mode (permission) in GIT?

Asked

Viewed 717 times

4

I’m working with the GIT here at the company where I work, along with two more programmers.

Every time I make one git pull, whose changes were sent by these two programmers, I always have trouble with the permission of the file or the folder they sent.

I realized that these two programmers liked to run GIT commands after using sudo su and log in with this "Super user". However, I do not do this. I use my user normally and, when necessary, I always run the command sudo before the other commands.

And I think that’s what’s recommended, because some programs like git, composer, bower or nodejs, generally recommend the non-use of sudo when we run them, precisely on account of file permissions.

It seems to me that’s really the problem. And every time, I have to run the command sudo chmod -R 777 . to solve this. And This is getting tiresome!.

Suppose I can’t convince my co-workers to stop using the sudo su, would have some way to disable the modo (the values of the file) permission?

I mean, I don’t want git add more information if a file has write permission or not, and these things.

I would like all files to be "recognized" as 0777.

How to do this in the GIT? How to disable this change mode that always appears when I give a git pull?

1 answer

6


Just change the setting core.filemode repository:

git config core.fileMode false

If you want to disable this for all your user repositories, add to flag --global:

git config --global core.fileMode false

Browser other questions tagged

You are not signed in. Login or sign up in order to post.