Git conflicts caused by File Permission modification and methods for ignoring File Permissions

Source: Internet
Author: User

Git conflicts caused by File Permission modification and methods for ignoring File Permissions

When we use git for version management, sometimes we only modify the file permissions, such as pack. php is changed to 777, but the file content has not changed, but git will think that the file has been modified because git regards the File Permission as part of the file difference. Perform the following test:

1. Modify the file permissions of the version library and use diff to view the changes.

 

As you can see, git also adds the File Permission to version management.

2. clone the version library in another location, modify the pack. php file, and submit it.

3. Update the content under the original library.

$ Git pull

The prompt conflict is displayed.

 

Solution:

You can add the configuration for ignoring file permissions in git as follows:

$ Git config core. filemode false

In this way, the object ACL is ignored. View the Configuration:

$ Cat. git/config



Then update the code.

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.