I see git allows me to choose any file I want as a global exclude file but it can't see that you can change the default global configuration file ?
Did I miss it or is it impossible? Are there workarounds ?
I see git allows me to choose any file I want as a global exclude file but it can't see that you can change the default global configuration file ?
Did I miss it or is it impossible? Are there workarounds ?
Copyright © 2021 Jogjafile Inc.
Git has 2 kinds of global configuration files. One is
~/.gitconfigand the other is$XDG_CONFIG_HOME/git/config.When
~/.gitconfigdoes not exist,$XDG_CONFIG_HOME/git/configworks as the global configuration file.We can create multiple
git/configunder different paths, for example/e/git/configand/f/git/config.When we want to use one of them as the global configuration file, first we rename
~/.gitconfig.And then assign a path to
XDG_CONFIG_HOMEwith eitherexport XDG_CONFIG_HOME=orXDG_CONFIG_HOME=,To use different names and emails,
When we want to use
~/.gitconfigagain,