Git's approach to conflicts caused by file permissions modification and ignoring file permissions

Source: Internet
Author: User

When we use git for versioning , sometimes we just modify the permissions of the file, such as changing the pack.php to 777, but the file content does not change, but git will think that the file has been modified, The reason is that git also counts file permissions as part of the file differences. Here's a test:

1. Modify the permissions of the repository file, and then use diff to view the changes.



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


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

This sets the Ignore file permission. View the following configuration:

$ cat. Git/config



Then update the code is OK.

Welcome reprint but please indicate Magento blog from Jonas!



Git's approach to conflicts caused by file permissions modification and ignoring file permissions

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.