Created
February 4, 2021 10:49
-
-
Save deeja/a4f1e3010ad16647513e9af21762c1ac to your computer and use it in GitHub Desktop.
Conditional Git Configuration on Windows
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Config in MY_WORK_DIRECTORY | |
[user] | |
name = "Work user" | |
email = [email protected] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ROOT CONFIG | |
# Check out https://blog.jiayu.co/2019/02/conditional-git-configuration/ | |
[user] | |
name = "Base user" | |
email = [email protected] | |
[core] | |
editor = \"C:/Program Files (x86)/GitExtensions/GitExtensions.exe\" fileeditor | |
[includeIf "gitdir:C:/development/MY_WORK_DIRECTORY/"] | |
path = C:/development/MY_WORK_DIRECTORY/.gitconfig |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Unfortunately, it doesn't work for me. "git config user.email" always returns the default user even I am in my work directory.
Windows 11 + git version 2.40.1.windows.1