Skip to content

includeIf gitdir config works for commits but not reflected in "Use global git credentials" UI #2760

@ZGGSONG

Description

@ZGGSONG

I'm using conditional Git config (includeIf) to switch user identity based on repository path. The configuration works correctly at the Git level (commits use the expected user), but Fork's UI still displays the global .gitconfig user under "Use global git credentials".

This creates confusion because the UI does not reflect the actual effective Git configuration.

Steps to Reproduce:

  1. Configure Git as follows:
# ~/.gitconfig
[user]
    name = Default User
    email = default@example.com

[includeIf "gitdir/i:D:/Others/gitR/"]
    path = ~/.gitconfig-gitR
# ~/.gitconfig-gitR
[user]
    name = GitR User
    email = gitr@example.com
  1. Open a repository located under:
D:/Others/gitR/
  1. In Fork:
    • Go to repository settings or preferences
    • Observe "Use global git credentials"

Expected Behavior:
Fork should display the effective Git user (after resolving includeIf), i.e.:

GitR User / gitr@example.com

Actual Behavior:
Fork displays the user from the main .gitconfig:

Default User / default@example.com

Additional Observations:

  • Running the following in the repository shows correct values:

    git config user.name
    git config user.email
    
  • Commits created via Fork also use the correct (conditional) identity.

  • This suggests Git itself resolves includeIf correctly, but Fork UI does not.

Environment:

  • OS: Windows 25H2(26200.8037)
  • Fork version: 2.18.0.0
  • Git version: 2.52.0.windows.1

Notes:
It appears Fork reads only the base .gitconfig for display instead of resolving the full config chain (includeIf). It would be helpful if the UI reflected the effective configuration, consistent with git config behavior.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions