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

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

    If

    git config --global core.filemode false
    

    does not work for you, do it manually:

    cd into yourLovelyProject folder
    

    cd into .git folder:

    cd .git
    

    edit the config file:

    nano config
    

    change true to false

    [core]
            repositoryformatversion = 0
            filemode = true
    

    ->

    [core]
            repositoryformatversion = 0
            filemode = false
    

    save, exit, go to upper folder:

    cd ..
    

    reinit the git

    git init
    

    you are done!

提交回复
热议问题