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

后端 未结 11 1408
天命终不由人
天命终不由人 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:56

    If you want to set this option for all of your repos, use the --global option.

    git config --global core.filemode false
    

    If this does not work you are probably using a newer version of git so try the --add option.

    git config --add --global core.filemode false
    

    If you run it without the --global option and your working directory is not a repo, you'll get

    error: could not lock config file .git/config: No such file or directory
    

提交回复
热议问题