3

I have the following files:

  • C:\Users\User\.gitconfig

    [includeIf "gitdir:C:/Development-Personal/"]
        path = development-personal.gitconfig
    
    [includeIf "gitdir:C:/Development-Work/"]
        path = development-work.gitconfig
    
  • C:\Users\User\development-personal.gitconfig

    [credential]
        helper = manager
    [user]
        name = PersonalNickname
        email = personal@email.com
    
  • C:\Users\User\development-work.gitconfig

    [user]
        name = WorkNickname
        email = work@email.com
    [http]
        sslVerify = false
    

Then I enter the folder C:\Development-Work\projects-git, right-click to a project folder Project and select the TortoiseGit client's ex. commit command and the pop-up window appears that I have to set the user's name and email before commit.

What do I miss in my configuration? Thank you for the help.


  • The version of my Git:

    C:\>git --version
    git version 2.18.0.windows.1
    
  • The version of my TortoiseGit

    TortoiseGit 2.6.0.0 (C:\Program Files\TortoiseGit\bin)
    git version 2.18.0.windows.1 (C:\Program Files\Git\bin; C:\Program Files\Git\mingw64\; 
    C:\Program Files\Git\mingw64\etc\gitconfig; C:\ProgramData\Git\config)
    
jub0bs
  • 60,866
  • 25
  • 183
  • 186
Nikolas Charalambidis
  • 40,893
  • 16
  • 117
  • 183
  • The above looks correct. Be sure your Git is sufficiently recent (2.13 or later) to support `includeIf`. I don't use Windows, but it might also be reasonable to use `gitdir/i:` to make the path matching case-insensitive. – torek Jul 16 '18 at 13:10
  • PS: sslVerify = false might be dangerous, see https://stackoverflow.com/a/26128676/3906760 – MrTux Jul 16 '18 at 13:28
  • MrTux: I am aware of this. Thanks. :)) – Nikolas Charalambidis Jul 16 '18 at 13:37

1 Answers1

3

Please make sure you have a recent enough version of Git (for Windows) installed (IIRC 2.13 or later, best sue the latest version).

Includeif does not work correctly until TortoiseGit 2.6.1 (cf. https://tortoisegit.org/issue/3184).

MrTux
  • 32,350
  • 30
  • 109
  • 146