How do I make Git ignore file mode (chmod) changes?

后端 未结 11 1245
天命终不由人
天命终不由人 2020-11-22 02:29

I have a project in which I have to change the mode of files with chmod to 777 while developing, but which should not change in the main repo.

Git pick

11条回答
  •  既然无缘
    2020-11-22 02:39

    Simple solution:

    Hit this Simple command in project Folder(it won't remove your original changes) ...it will only remove changes that had been done while you changed project folder permission

    command is below:

    git config core.fileMode false

    Why this all unnecessary file get modified: because you have changed the project folder permissions with commend sudo chmod -R 777 ./yourProjectFolder

    when will you check changes what not you did? you found like below while using git diff filename

    old mode 100644
    new mode 100755
    

提交回复
热议问题