When publishing the project to the line, many times need to modify the file permissions, if the use of GIT version management software to publish, then the next time you update the online file will prompt file conflicts. Obviously the document has not changed, why conflict? It turns out that git also counts file permissions as part of the file differences. The following author has made a simple example to illustrate this situation.
1. Modify the permissions of the repository file, and then use diff to view the changes.
$ chmod 777 pack.php$ git diff pack.php
Git file Permissions Modification example
You can see that git also includes file permissions in version management.
2, in another Place clone this repository, modify the pack.php file, and then submit.
3. Update the content below the original repository.
$ git pull
Conflicts caused by Git file permissions modification
You can see a prompt conflict.
Workaround:
In Git, you can add a configuration that ignores file permissions, as follows:
$ git config core.filemode false //Current Repository
$ git config--global core.filemode false//All repository
This sets the Ignore file permission. View the following configuration:
$ cat. Git/config//View git's configuration file
Git ignores the configuration of file permissions
Then update the code is OK.
Ignore file permissions or file owner changes in git