My ~/.gitconfig contains this include section to inherit from a team-wide config file.
[include]
~/.gitconfig.team
However, I have personal repos where I don't want to inherit from this .gitconfig.team.
Is there a way I can override/force unset this section in my personal repos? E.g., something I can add to .git/config in personal_project/?
I'm interested in a solution where I modify configs in my personal repos instead of my team repos.
Git config includes operate:
as if its contents had been found at the location of the include directive
ref
That means you can't override/remove the include itself, as as soon as it's found the contents of the included file are injected/loaded.
You can of course override the settings it contains in a more specific config file:
# ~/.git.config.team
[user]
name = name
Locally, via git config user.name nic
# /some/project/.git/config
[user]
name = alias
Yielding:
/some/project $ git config user.name
alias
/some/project $
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With