Skip to content

Support GIT_CONFIG_GLOBAL and GIT_CONFIG_SYSTEM env vars#3391

Open
mitre88 wants to merge 1 commit intoBurntSushi:masterfrom
mitre88:fix/gitconfig-env-vars
Open

Support GIT_CONFIG_GLOBAL and GIT_CONFIG_SYSTEM env vars#3391
mitre88 wants to merge 1 commit intoBurntSushi:masterfrom
mitre88:fix/gitconfig-env-vars

Conversation

@mitre88
Copy link
Copy Markdown

@mitre88 mitre88 commented May 4, 2026

Summary

Implement support for Git 2.32+ environment variables GIT_CONFIG_GLOBAL and GIT_CONFIG_SYSTEM for finding core.excludesFile in the ignore crate.

These environment variables are checked before falling back to traditional paths (~/.gitconfig, $XDG_CONFIG_HOME/git/config).

Fixes #3275

Changes

  • Added git_config_global_path() function to read GIT_CONFIG_GLOBAL env var
  • Added git_config_system_path() function to read GIT_CONFIG_SYSTEM env var
  • Added read_gitconfig() helper to read git config files
  • Updated gitconfig_excludes_path() to check these env vars first

Testing

All existing tests pass.

Implement support for Git 2.32+ environment variables
GIT_CONFIG_GLOBAL and GIT_CONFIG_SYSTEM for finding core.excludesFile.
These are checked before falling back to traditional paths.

Fixes BurntSushi#3275
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support GIT_CONFIG_GLOBAL and GIT_CONFIG_SYSTEM environment variables for finding core.excludesFile

1 participant