1

Git is not ignoring file permission changes even filemode = false. In my global file file-mode is off but whenever i changes permission for any folder in my project it is tracking and showing in diff. i don't want to track my permission changes at all.

settings in my ~/.gitconfig

[core]
    editor = vim
    autocrlf = false
    filemode = false

git version 2.7.4

owais
  • 4,752
  • 5
  • 31
  • 41
  • 2
    Have you read [this](http://stackoverflow.com/questions/1580596/how-do-i-make-git-ignore-file-mode-chmod-changes)? A few quotes: "This setting only cover the executable bit of mode and never the read/write bits." "The global setting won't be applied to existing repos." – Ruud Helderman Aug 19 '16 at 11:53
  • ahh it's not mentioned in already posted answer at stackoverflow. "The global setting won't be applied to existing repos". by changing local setting file .git/config now it's not tracking changes. @Ruud thanks post as answer so i can accept it. – owais Aug 19 '16 at 11:58

1 Answers1

3

Existing repositories typically are not affected by your changing the global setting.

From git-config(1):

git config will only ever change one file at a time.

Creating a new repo (git init) puts an explicit filemode line in the newly created local .git/config file; even when the global ~/.gitconfig file has no such line (in which case the hard-coded default value true will be used). Changing the global configuration afterwards will not change that; it will only affect subsequent git-inits.

With thanks to @jeremyclarke for his valuable comment on this answer:

PLEASE add a second warning to this answer, stating that the global setting won't be applied to existing repos! For each repo you need to run the local command (or it seems "git init" has the same effect). This will affect pretty much everyone and can be extremely confusing (esp. when you first interact with a second repo and have no idea why the global setting isn't working when it worked on the first repo, where you ran both the global and local versions of the setting change.)

Community
  • 1
  • 1
Ruud Helderman
  • 10,563
  • 1
  • 26
  • 45