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.)